Build GSI #63
Workflow file for this run
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: | |
CCACHE_COMPRESS: 1 | |
CCACHE_MAXSIZE: 50G | |
DISABLE_RUNNER_CLEANUP: false # should ONLY be set to true if ABSOLUTELY necessary | |
ROM_NAME: VoltageOS | |
ROM_VERSION: 3.1 | |
USE_CCACHE: 1 | |
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@v2 | |
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: initialize ccache | |
run: ccache -M 50G -F 0 | |
- name: build standard image | |
run: | | |
. build/envsetup.sh | |
lunch treble_arm64_bvN-userdebug | |
make systemimage -j"$(nproc --all)" | |
- name: run vndk-sepolicy tests | |
run: make vndk-test-sepolicy | |
working-directory: vendor/vndk-tests | |
- name: create vndklite image | |
run: | | |
git clone --depth=1 https://github.com/ponces/treble_adapter.git | |
cd treble_adapter/ | |
cp -v ../out/target/product/tdgsi_arm64_ab/system.img standard_system.img | |
sudo bash lite-adapter.sh 64 standard_system.img | |
sudo chown -R $(whoami):$(id | awk -F'[()]' '{ print $2 }') . | |
- name: rename image files | |
id: rename-image-files | |
run: | | |
buildDate=$(date +%Y%m%d) | |
mv -v out/target/product/tdgsi_arm64_ab/system.img "${ROM_NAME}"-arm64-ab-"${ROM_VERSION}"-"${buildDate}"-UNOFFICIAL.img | |
mv -v treble_adapter/s.img "${ROM_NAME}"-arm64-ab-vndklite-"${ROM_VERSION}"-"${buildDate}"-UNOFFICIAL.img | |
- name: compress standard image with xz | |
run: xz -9 -T0 -v -z "${ROM_NAME}"-arm64-ab-"${ROM_VERSION}"-*-UNOFFICIAL.img | |
- name: compress vndklite image with xz | |
run: xz -9 -T0 -v -z "${ROM_NAME}"-arm64-ab-vndklite-"${ROM_VERSION}"-*-UNOFFICIAL.img | |
- name: upload 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 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: 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 |