Build GSI #158
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build GSI | |
on: | |
workflow_dispatch: | |
env: | |
DISABLE_RUNNER_CLEANUP: false # should ONLY be set to true if ABSOLUTELY necessary | |
ROM_NAME: VoltageOS | |
ROM_VERSION: 3.2 | |
jobs: | |
build-gsi: | |
runs-on: [self-hosted] | |
steps: | |
- name: setup git config | |
run: | | |
git config --global user.email "androidbuild@localhost" | |
git config --global user.name "androidbuild" | |
- name: checkout basic repo | |
uses: actions/checkout@v4 | |
- name: clone rom manifest | |
run: repo init -u https://github.com/VoltageOS/manifest.git -b 14 --depth=1 | |
- name: copy manifest config | |
run: | | |
mkdir -p .repo/local_manifests | |
cp -v manifest.xml .repo/local_manifests/ | |
- name: setup git-lfs hook | |
run: git lfs install | |
- name: perform full sources sync (with auto retry) | |
uses: nick-fields/retry@v3 | |
with: | |
command: repo sync -c -j8 --force-sync --no-clone-bundle --no-tags # set to 8 cores to slow down sync and avoid github-actions timeouts | |
max_attempts: 3 | |
retry_on: error | |
timeout_minutes: 20 | |
- name: fetch all git-lfs objects | |
run: | | |
grep -l 'merge=lfs' $( find $PWD -name .gitattributes ) /dev/null | while IFS= read -r line; do | |
dir=$(dirname $line) | |
echo $dir | |
( cd $dir ; git lfs pull ) | |
done | |
- name: apply patches | |
run: | | |
./patches/apply.sh . trebledroid | |
./patches/apply.sh . personal | |
- name: generate base rom config | |
run: | | |
cp -v ../../../Voltage.mk . | |
bash generate.sh Voltage | |
working-directory: device/phh/treble | |
- name: build treble app | |
run: | | |
. build/envsetup.sh | |
cd treble_app/ | |
bash build.sh release | |
cp -v TrebleApp.apk ../vendor/hardware_overlay/TrebleApp/app.apk | |
- name: build standard arm64 image | |
run: | | |
. build/envsetup.sh | |
lunch treble_arm64_bvN-userdebug | |
make systemimage -j"$(nproc --all)" | |
- name: run vndk sepolicy tests (as early as possible) | |
run: | | |
. build/envsetup.sh | |
lunch treble_arm64_bvN-userdebug | |
make vndk-test-sepolicy | |
- name: build standard arm32_binder64 image | |
run: | | |
. build/envsetup.sh | |
lunch treble_a64_bvN-userdebug | |
make systemimage -j"$(nproc --all)" | |
- name: create vndklite arm64 image | |
run: | | |
cp -v ../out/target/product/tdgsi_arm64_ab/system.img standard_system_arm64.img | |
sudo bash lite-adapter.sh 64 standard_system_arm64.img | |
sudo mv s.img s_arm64.img | |
sudo chown $(whoami):$(id | awk -F'[()]' '{ print $2 }') s_arm64.img | |
working-directory: treble_adapter | |
- name: create vndklite arm32_binder64 image | |
run: | | |
cp -v ../out/target/product/tdgsi_a64_ab/system.img standard_system_arm32_binder64.img | |
sudo bash lite-adapter.sh 32 standard_system_arm32_binder64.img | |
sudo mv s.img s_arm32_binder64.img | |
sudo chown $(whoami):$(id | awk -F'[()]' '{ print $2 }') s_arm32_binder64.img | |
working-directory: treble_adapter | |
- name: rename image files | |
run: | | |
buildDate=$(date +%Y%m%d) | |
cp -v out/target/product/tdgsi_arm64_ab/system.img "${ROM_NAME}"-arm64-ab-"${ROM_VERSION}"-"${buildDate}"-UNOFFICIAL.img | |
cp -v out/target/product/tdgsi_a64_ab/system.img "${ROM_NAME}"-arm32_binder64-ab-"${ROM_VERSION}"-"${buildDate}"-UNOFFICIAL.img | |
cp -v treble_adapter/s_arm64.img "${ROM_NAME}"-arm64-ab-vndklite-"${ROM_VERSION}"-"${buildDate}"-UNOFFICIAL.img | |
cp -v treble_adapter/s_arm32_binder64.img "${ROM_NAME}"-arm32_binder64-ab-vndklite-"${ROM_VERSION}"-"${buildDate}"-UNOFFICIAL.img | |
- name: compress all images with xz | |
run: find . -maxdepth 1 -name '*.img' -exec xz -9 -T0 -v -z "{}" \; | |
- name: upload arm64 standard image to temp.sh | |
run: find . -maxdepth 1 -name "${ROM_NAME}-arm64-ab-${ROM_VERSION}-*-UNOFFICIAL.img.xz" -exec curl -F "file=@{}" https://temp.sh/upload \; | |
- name: upload arm64 vndklite image to temp.sh | |
run: find . -maxdepth 1 -name "${ROM_NAME}-arm64-ab-vndklite-${ROM_VERSION}-*-UNOFFICIAL.img.xz" -exec curl -F "file=@{}" https://temp.sh/upload \; | |
- name: upload arm32_binder64 standard image to temp.sh | |
run: find . -maxdepth 1 -name "${ROM_NAME}-arm32_binder64-ab-${ROM_VERSION}-*-UNOFFICIAL.img.xz" -exec curl -F "file=@{}" https://temp.sh/upload \; | |
- name: upload arm32_binder64 vndklite image to temp.sh | |
run: find . -maxdepth 1 -name "${ROM_NAME}-arm32_binder64-ab-vndklite-${ROM_VERSION}-*-UNOFFICIAL.img.xz" -exec curl -F "file=@{}" https://temp.sh/upload \; | |
- name: cleanup work directory | |
uses: eviden-actions/clean-self-hosted-runner@v1 | |
if: ${{ always() }} # Run even if previous steps in the job fail or are canceled |