Browse Source

Change condition; Change artifact name; Add retry for downloading SDK

master
wchen342 2 years ago
parent
commit
02b0ebd941
Signed by untrusted user: wchen342 GPG Key ID: 720B70365E800508
  1. 18
      .github/workflows/build.yml
  2. 10
      build.sh

18
.github/workflows/build.yml

@ -1,4 +1,4 @@
name: Ungoogled-chromium-android ChromePublic arm64 build
name: Ungoogled-chromium-android build
on: [push, pull_request, repository_dispatch]
jobs:
@ -6,7 +6,7 @@ jobs:
env:
container_name: archlinuxlatest_47dabf
XHYVE_CPU_COUNT: 4
XHYVE_MEMORY_SIZE: 11264
XHYVE_MEMORY_SIZE: 10240
XHYVE_DISK_SIZE: 30000
name: Build Chromium Android
runs-on: macos-latest
@ -17,9 +17,6 @@ jobs:
target: [chrome_public_apk, monochrome_public_apk]
steps:
- name: Stop if Monochrome+arm64
if: matrix.arch == 'arm64' && matrix.target == 'monochrome_public_apk'
run: exit 1 # Is there a better way to stop?
- name: Check Environment
run: |
pwd
@ -36,16 +33,16 @@ jobs:
- name: Install Docker
run: |
brew install docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
# brew cask install virtualbox
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
brew services start docker-machine
brew cleanup -s && rm -rf $(brew --cache)
- name: Create Docker Machine
env:
machine_config_path: /Users/runner/.docker/machine/machines/default
run: |
mkdir -p ~/.docker/machine/cache
curl -Lo ~/.docker/machine/cache/boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v19.03.5/boot2docker.iso
for i in $(seq 1 5); do docker-machine create --driver xhyve default && s=0 && break || s=$? && docker-machine rm -f default && sleep 15; done; (exit $s) # Retry 5 times in case of failure
for i in $(seq 1 10); do docker-machine create --driver xhyve default && s=0 && break || sudo kill -9 `ps aux | grep xhyve | grep -v grep | awk '{print $2}'` && sudo rm -rf ${machine_config_path} && s=$? && sleep 15; done; (exit $s) # Retry 10 times before abort
docker-machine ssh default pwd
docker-machine ssh default id -un
docker-machine ssh default mkdir -p /home/docker/work/_temp /home/docker/work/_actions /home/docker/work/_temp/_github_home /home/docker/work/_temp/_github_workflow
@ -90,6 +87,7 @@ jobs:
docker exec ${container_name} bash -c './Miniconda3-latest-Linux-x86_64.sh -b -p ~/anaconda && rm -rf Miniconda3-latest-Linux-x86_64.sh'
docker exec ${container_name} bash -c 'source ~/anaconda/bin/activate && conda init && conda create -y --name py2 python=2 && conda activate py2 && pip install six'
- name: Build
if: matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk'
run: |
docker-machine env default
eval "$(docker-machine env default)"
@ -98,6 +96,7 @@ jobs:
- name: Move artifact
env:
SUMS: checksums.txt
if: matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk'
run: |
docker-machine env default
eval "$(docker-machine env default)"
@ -109,6 +108,7 @@ jobs:
cat $SUMS
- uses: actions/[email protected]
name: Upload artifact
if: matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk'
with:
name: Ungoogled-chromium-android
name: ${{ matrix.target }}-${{ matrix.arch }}
path: ../artifact/

10
build.sh

@ -205,13 +205,17 @@ popd
sdk_link="https://android-rebuilds.beuc.net/dl/bundles/android-sdk_user.9.0.0_r21_linux-x86.zip"
sdk_tools_link="https://android-rebuilds.beuc.net/dl/repository/sdk-repo-linux-tools-26.1.1.zip"
ndk_link="https://android-rebuilds.beuc.net/dl/repository/android-ndk-r20b-linux-x86_64.tar.bz2"
sdk_tools_link="https://android-rebuilds.beuc.net/dl/repository/sdk-repo-linux-tools-26.1.1.zip"
ndk_link="https://android-rebuilds.beuc.net/dl/repository/android-ndk-r20b-linux-x86_64.tar.bz2"
mkdir android-rebuilds
mkdir android-sdk
mkdir android-ndk
pushd android-rebuilds
curl -O ${sdk_link} && unzip -qqo android-sdk_user.9.0.0_r21_linux-x86.zip -d ../android-sdk && rm -f android-sdk_user.9.0.0_r21_linux-x86.zip
curl -O ${sdk_tools_link} && unzip -qqo sdk-repo-linux-tools-26.1.1.zip -d ../android-sdk/android-sdk_user.9.0.0_r21_linux-x86 && rm -f sdk-repo-linux-tools-26.1.1.zip
curl -O ${ndk_link} && tar xjf android-ndk-r20b-linux-x86_64.tar.bz2 -C ../android-ndk && rm -f android-ndk-r20b-linux-x86_64.tar.bz2
for i in $(seq 1 5); do curl -O ${sdk_link} && unzip -qqo android-sdk_user.9.0.0_r21_linux-x86.zip -d ../android-sdk && rm -f android-sdk_user.9.0.0_r21_linux-x86.zip && s=0 && break || s=$? && sleep 15; done; (exit $s)
for i in $(seq 1 5); do curl -O ${sdk_tools_link} && unzip -qqo sdk-repo-linux-tools-26.1.1.zip -d ../android-sdk/android-sdk_user.9.0.0_r21_linux-x86 && rm -f sdk-repo-linux-tools-26.1.1.zip && s=0 && break || s=$? && sleep 15; done; (exit $s)
for i in $(seq 1 5); do curl -O ${ndk_link} && tar xjf android-ndk-r20b-linux-x86_64.tar.bz2 -C ../android-ndk && rm -f android-ndk-r20b-linux-x86_64.tar.bz2 && s=0 && break || s=$? && sleep 15; done; (exit $s)
popd
# Move ndk files into place
cp -a "temp/${gn_file}" android-ndk/android-ndk-r20b

Loading…
Cancel
Save