From 960f1ad82855583471f0d469c8af100ec8b9d7fa Mon Sep 17 00:00:00 2001 From: tiopex Date: Mon, 21 Jul 2025 22:30:57 +0200 Subject: [PATCH] Actions: CI improvements --- .../workflows/build-aarch64-emu-libretro.yml | 71 ++++++++++-------- .../build-aarch64-emu-standalone.yml | 59 +++++++++------ .github/workflows/build-aarch64-image.yml | 9 --- .github/workflows/build-aarch64-mame-lr.yml | 50 ++++++------- .github/workflows/build-aarch64-qt6.yml | 49 ++++++------ .github/workflows/build-aarch64-toolchain.yml | 41 +++++----- .github/workflows/build-aarch64.yml | 74 +++++++++++++------ .github/workflows/build-arm.yml | 44 ++++++++++- .github/workflows/build-device.yml | 7 ++ .github/workflows/build-nightly.yml | 6 +- distributions/ROCKNIX/options | 3 + .../ROCKNIX/packages/virtual/image/package.mk | 5 +- 12 files changed, 249 insertions(+), 169 deletions(-) diff --git a/.github/workflows/build-aarch64-emu-libretro.yml b/.github/workflows/build-aarch64-emu-libretro.yml index 5c4f4b1e1a..33ee8a5c3a 100644 --- a/.github/workflows/build-aarch64-emu-libretro.yml +++ b/.github/workflows/build-aarch64-emu-libretro.yml @@ -51,15 +51,10 @@ jobs: with: fetch-depth: 0 - - name: Retrieve ccache aarch64 - id: retrieve-cache - uses: actions/cache/restore@v4 - with: - path: ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache - key: ccache-aarch64-${{ inputs.DEVICE }}-emu-libretro-${{ github.sha }} - restore-keys: | - ccache-aarch64-${{ inputs.DEVICE }}-emu-libretro-${{ github.sha }} - ccache-aarch64-${{ inputs.DEVICE }}-emu-libretro- + - name: Retrieve ccache + run: | + URL="https://github.com/${{ github.repository_owner }}/distribution-cache/releases/download/ccache/ccache-aarch64-${{ inputs.DEVICE }}-emu-libretro.tar" + curl -L --fail --silent --show-error "$URL" | tar -xvf - || echo "Cache archive not found, skipping." - name: Download aarch64 (${{ inputs.DEVICE }}) uses: actions/download-artifact@v4 @@ -77,6 +72,22 @@ jobs: - name: Clean up compressed aarch64 file run: rm build.aarch64.tar + - name: Download build aarch64 (${{ inputs.DEVICE }}) + uses: actions/download-artifact@v4 + with: + name: aarch64 build (${{ inputs.DEVICE }}) + + - name: Extract artifact aarch64 build + uses: corrupt952/actions-retry-command@v1.0.7 + with: + command: | + tar -xf build.build.aarch64.tar + max_attempts: 3 + retry_interval: 10 + + - name: Clean up compressed aarch64 file + run: rm build.build.aarch64.tar + - name: Download qt6 (${{ inputs.DEVICE }}) if: ${{ inputs.DEVICE == 'RK3399' || inputs.DEVICE == 'RK3566' || inputs.DEVICE == 'RK3588' || inputs.DEVICE == 'S922X' || inputs.DEVICE == 'SM8250' || inputs.DEVICE == 'SM8550' }} uses: actions/download-artifact@v4 @@ -85,8 +96,12 @@ jobs: - name: Extract artifact qt6 if: ${{ inputs.DEVICE == 'RK3399' || inputs.DEVICE == 'RK3566' || inputs.DEVICE == 'RK3588' || inputs.DEVICE == 'S922X' || inputs.DEVICE == 'SM8250' || inputs.DEVICE == 'SM8550' }} - run: | - sudo tar --zstd -xf build.qt6.tar.zst --same-owner + uses: corrupt952/actions-retry-command@v1.0.7 + with: + command: | + sudo tar --zstd -xf build.qt6.tar.zst --same-owner + max_attempts: 3 + retry_interval: 10 - name: Clean up compressed qt6 file if: ${{ inputs.DEVICE == 'RK3399' || inputs.DEVICE == 'RK3566' || inputs.DEVICE == 'RK3588' || inputs.DEVICE == 'S922X' || inputs.DEVICE == 'SM8250' || inputs.DEVICE == 'SM8550' }} @@ -104,10 +119,6 @@ jobs: - name: Clean up compressed mame-lr file run: rm build.mame-lr.tar.zst - - name: Expand ccache - run: | - ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -d ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache -M 20G - - name: Build uses: corrupt952/actions-retry-command@v1.0.7 with: @@ -130,31 +141,31 @@ jobs: output.log ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.threads/logs/ - - name: Delete used cache - if: ${{ steps.retrieve-cache.outputs.cache-hit && steps.retrieve-cache.outputs.cache-matched-key != env.CACHE_KEY }} - continue-on-error: true - env: - GH_REPO: ${{ github.repository }} - GH_TOKEN: ${{ github.token }} - run: | - gh extension install actions/gh-actions-cache - gh actions-cache delete "${{ steps.retrieve-cache.outputs.cache-matched-key }}" -R $GH_REPO --confirm - - name: Clean ccache run: | export CCACHE_DIR=./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -s -v - ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -M 1.2G + ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -M 1.9G ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -c ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -s -v ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -z + - name: Tar ccache + run: | + tar -cf ccache-aarch64-${{ inputs.DEVICE }}-emu-libretro.tar ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache + - name: Save ccache - if: ${{ ! steps.retrieve-cache.outputs.cache-hit || steps.retrieve-cache.outputs.cache-matched-key != env.CACHE_KEY }} - uses: actions/cache/save@v4 + uses: ncipollo/release-action@v1 with: - path: ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache - key: ccache-aarch64-${{ inputs.DEVICE }}-emu-libretro-${{ github.sha }} + tag: ccache + artifacts: ccache-aarch64-${{ inputs.DEVICE }}-emu-libretro.tar + allowUpdates: true + makeLatest: true + prerelease: true + body: ccache + token: ${{ secrets.GH_PAT }} + repo: distribution-cache + continue-on-error: true - name: Print space run: df -h diff --git a/.github/workflows/build-aarch64-emu-standalone.yml b/.github/workflows/build-aarch64-emu-standalone.yml index 512fa7e50c..d6272eed80 100644 --- a/.github/workflows/build-aarch64-emu-standalone.yml +++ b/.github/workflows/build-aarch64-emu-standalone.yml @@ -70,15 +70,10 @@ jobs: with: fetch-depth: 0 - - name: Retrieve ccache aarch64 - id: retrieve-cache - uses: buildjet/cache/restore@v4 - with: - path: ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache - key: ccache-aarch64-${{ inputs.DEVICE }}-emu-standalone-${{ github.sha }} - restore-keys: | - ccache-aarch64-${{ inputs.DEVICE }}-emu-standalone-${{ github.sha }} - ccache-aarch64-${{ inputs.DEVICE }}-emu-standalone- + - name: Retrieve ccache + run: | + URL="https://github.com/${{ github.repository_owner }}/distribution-cache/releases/download/ccache/ccache-aarch64-${{ inputs.DEVICE }}-emu-standalone.tar" + curl -L --fail --silent --show-error "$URL" | tar -xvf - || echo "Cache archive not found, skipping." - name: Download aarch64 (${{ inputs.DEVICE }}) uses: actions/download-artifact@v4 @@ -96,6 +91,22 @@ jobs: - name: Clean up compressed aarch64 file run: rm build.aarch64.tar + - name: Download build aarch64 (${{ inputs.DEVICE }}) + uses: actions/download-artifact@v4 + with: + name: aarch64 build (${{ inputs.DEVICE }}) + + - name: Extract artifact aarch64 build + uses: corrupt952/actions-retry-command@v1.0.7 + with: + command: | + tar -xf build.build.aarch64.tar + max_attempts: 3 + retry_interval: 10 + + - name: Clean up compressed aarch64 file + run: rm build.build.aarch64.tar + - name: Download qt6 (${{ inputs.DEVICE }}) if: ${{ inputs.DEVICE == 'RK3399' || inputs.DEVICE == 'RK3566' || inputs.DEVICE == 'RK3588' || inputs.DEVICE == 'S922X' || inputs.DEVICE == 'SM8250' || inputs.DEVICE == 'SM8550' }} uses: actions/download-artifact@v4 @@ -111,10 +122,6 @@ jobs: if: ${{ inputs.DEVICE == 'RK3399' || inputs.DEVICE == 'RK3566' || inputs.DEVICE == 'RK3588' || inputs.DEVICE == 'S922X' || inputs.DEVICE == 'SM8250' || inputs.DEVICE == 'SM8550' }} run: rm build.qt6.tar.zst - - name: Expand ccache - run: | - ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -d ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache -M 20G - - name: Build uses: corrupt952/actions-retry-command@v1.0.7 with: @@ -137,27 +144,31 @@ jobs: output.log ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.threads/logs/ - - name: Delete used cache - if: ${{ steps.retrieve-cache.outputs.cache-hit && steps.retrieve-cache.outputs.cache-matched-key != env.CACHE_KEY }} - uses: buildjet/cache-delete@v1 - with: - cache_key: ${{ steps.retrieve-cache.outputs.cache-matched-key }} - - name: Clean ccache run: | export CCACHE_DIR=./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -s -v - ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -M 1.4G + ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -M 1.9G ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -c ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -s -v ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -z + - name: Tar ccache + run: | + tar -cf ccache-aarch64-${{ inputs.DEVICE }}-emu-standalone.tar ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache + - name: Save ccache - if: ${{ ! steps.retrieve-cache.outputs.cache-hit || steps.retrieve-cache.outputs.cache-matched-key != env.CACHE_KEY }} - uses: buildjet/cache/save@v4 + uses: ncipollo/release-action@v1 with: - path: ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache - key: ccache-aarch64-${{ inputs.DEVICE }}-emu-standalone-${{ github.sha }} + tag: ccache + artifacts: ccache-aarch64-${{ inputs.DEVICE }}-emu-standalone.tar + allowUpdates: true + makeLatest: true + prerelease: true + body: ccache + token: ${{ secrets.GH_PAT }} + repo: distribution-cache + continue-on-error: true - name: Print space run: df -h diff --git a/.github/workflows/build-aarch64-image.yml b/.github/workflows/build-aarch64-image.yml index 547f447c4c..86ddb7264b 100644 --- a/.github/workflows/build-aarch64-image.yml +++ b/.github/workflows/build-aarch64-image.yml @@ -118,9 +118,6 @@ jobs: - name: Clean up compressed emu-standalone file run: rm build.emu-standalone.tar* - - name: Expand ccache - run: | - ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -d ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache -M 1G # clean to rebuild retroarch with 32bit enabled - name: Clean retroarch run: | @@ -152,12 +149,6 @@ jobs: output.log ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.threads/logs/ - - name: Delete used cache - if: ${{ steps.retrieve-cache.outputs.cache-hit && steps.retrieve-cache.outputs.cache-matched-key != env.CACHE_KEY }} - uses: buildjet/cache-delete@v1 - with: - cache_key: ${{ steps.retrieve-cache.outputs.cache-matched-key }} - - name: Get date run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV diff --git a/.github/workflows/build-aarch64-mame-lr.yml b/.github/workflows/build-aarch64-mame-lr.yml index 71cb9b332a..4ce6178c08 100644 --- a/.github/workflows/build-aarch64-mame-lr.yml +++ b/.github/workflows/build-aarch64-mame-lr.yml @@ -45,15 +45,10 @@ jobs: with: fetch-depth: 0 - - name: Retrieve ccache aarch64 - id: retrieve-cache - uses: buildjet/cache/restore@v4 - with: - path: ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache - key: ccache-aarch64-${{ inputs.DEVICE }}-mame-${{ github.sha }} - restore-keys: | - ccache-aarch64-${{ inputs.DEVICE }}-mame-${{ github.sha }} - ccache-aarch64-${{ inputs.DEVICE }}-mame- + - name: Retrieve ccache + run: | + URL="https://github.com/${{ github.repository_owner }}/distribution-cache/releases/download/ccache/ccache-aarch64-${{ inputs.DEVICE }}-mame.tar" + curl -L --fail --silent --show-error "$URL" | tar -xvf - || echo "Cache archive not found, skipping." - name: Download aarch64-toolchain (${{ inputs.DEVICE }}) uses: actions/download-artifact@v4 @@ -61,15 +56,16 @@ jobs: name: aarch64-toolchain (${{ inputs.DEVICE }}) - name: Extract artifact aarch64-toolchain - run: | - tar --zstd -xf build.aarch64-toolchain.tar.zst + uses: corrupt952/actions-retry-command@v1.0.7 + with: + command: | + tar --zstd -xf build.aarch64-toolchain.tar.zst + max_attempts: 3 + retry_interval: 10 - name: Clean up compressed aarch64 file run: rm build.aarch64-toolchain.tar.zst - - name: Expand ccache - run: | - ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -d ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache -M 20G - name: Build uses: corrupt952/actions-retry-command@v1.0.7 @@ -93,27 +89,31 @@ jobs: output.log ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.threads/logs/ - - name: Delete used cache - if: ${{ steps.retrieve-cache.outputs.cache-hit && steps.retrieve-cache.outputs.cache-matched-key != env.CACHE_KEY }} - uses: buildjet/cache-delete@v1 - with: - cache_key: ${{ steps.retrieve-cache.outputs.cache-matched-key }} - - name: Clean ccache run: | export CCACHE_DIR=./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -s -v - ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -M 400M + ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -M 500M ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -c ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -s -v ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -z + - name: Tar ccache + run: | + tar -cf ccache-aarch64-${{ inputs.DEVICE }}-mame.tar ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache + - name: Save ccache - if: ${{ ! steps.retrieve-cache.outputs.cache-hit || steps.retrieve-cache.outputs.cache-matched-key != env.CACHE_KEY }} - uses: buildjet/cache/save@v4 + uses: ncipollo/release-action@v1 with: - path: ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache - key: ccache-aarch64-${{ inputs.DEVICE }}-mame-${{ github.sha }} + tag: ccache + artifacts: ccache-aarch64-${{ inputs.DEVICE }}-mame.tar + allowUpdates: true + makeLatest: true + prerelease: true + body: ccache + token: ${{ secrets.GH_PAT }} + repo: distribution-cache + continue-on-error: true - name: Compress directory run: | diff --git a/.github/workflows/build-aarch64-qt6.yml b/.github/workflows/build-aarch64-qt6.yml index 7c2ac96866..72bebdf112 100644 --- a/.github/workflows/build-aarch64-qt6.yml +++ b/.github/workflows/build-aarch64-qt6.yml @@ -50,15 +50,10 @@ jobs: with: fetch-depth: 0 - - name: Retrieve ccache aarch64 - id: retrieve-cache - uses: buildjet/cache/restore@v4 - with: - path: ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache - key: ccache-aarch64-${{ inputs.DEVICE }}-qt6-${{ github.sha }} - restore-keys: | - ccache-aarch64-${{ inputs.DEVICE }}-qt6-${{ github.sha }} - ccache-aarch64-${{ inputs.DEVICE }}-qt6- + - name: Retrieve ccache + run: | + URL="https://github.com/${{ github.repository_owner }}/distribution-cache/releases/download/ccache/ccache-aarch64-${{ inputs.DEVICE }}-qt6.tar" + curl -L --fail --silent --show-error "$URL" | tar -xvf - || echo "Cache archive not found, skipping." - name: Download aarch64 (${{ inputs.DEVICE }}) uses: actions/download-artifact@v4 @@ -76,10 +71,6 @@ jobs: - name: Clean up compressed aarch64 file run: rm build.aarch64.tar - - name: expand ccache - run: | - ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -d ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache -M 20G - - name: Build uses: corrupt952/actions-retry-command@v1.0.7 with: @@ -88,7 +79,7 @@ jobs: touch timestamp_before set -e { docker run --init --env-file .env --rm --user $(id -u):$(id -g) -v ${PWD}:${PWD} -w ${PWD} "ghcr.io/${{ inputs.OWNER_LC }}/rocknix-build:latest" \ - bash -c "./scripts/build_mt qt6"; echo $? > docker_exit_code; } | tee output.log | grep -E --color=never --line-buffered "^GET|^UNPACK|^BUILD|^INSTALL" || true + bash -c "./scripts/build_mt qt6 modules"; echo $? > docker_exit_code; } | tee output.log | grep -E --color=never --line-buffered "^GET|^UNPACK|^BUILD|^INSTALL" || true exit_code=$( qt6.txt - tar --zstd -cf build.qt6.tar.zst -T qt6.txt + tar --zstd --exclude='build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/build' -cf build.qt6.tar.zst \ + build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/ - uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/build-aarch64-toolchain.yml b/.github/workflows/build-aarch64-toolchain.yml index 443735ed29..f3b33a80f7 100644 --- a/.github/workflows/build-aarch64-toolchain.yml +++ b/.github/workflows/build-aarch64-toolchain.yml @@ -48,15 +48,10 @@ jobs: with: fetch-depth: 0 - - name: Retrieve ccache aarch64-toolchain - id: retrieve-cache - uses: actions/cache/restore@v4 - with: - path: ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache - key: ccache-aarch64-${{ inputs.DEVICE }}-toolchain-${{ github.sha }} - restore-keys: | - ccache-aarch64-${{ inputs.DEVICE }}-toolchain-${{ github.sha }} - ccache-aarch64-${{ inputs.DEVICE }}-toolchain- + - name: Retrieve ccache + run: | + URL="https://github.com/${{ github.repository_owner }}/distribution-cache/releases/download/ccache/ccache-aarch64-${{ inputs.DEVICE }}-toolchain.tar" + curl -L --fail --silent --show-error "$URL" | tar -xvf - || echo "Cache archive not found, skipping." - name: Build uses: corrupt952/actions-retry-command@v1.0.7 @@ -80,16 +75,6 @@ jobs: output.log ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.threads/logs/ - - name: Delete used cache - if: ${{ steps.retrieve-cache.outputs.cache-hit && steps.retrieve-cache.outputs.cache-matched-key != env.CACHE_KEY }} - continue-on-error: true - env: - GH_REPO: ${{ github.repository }} - GH_TOKEN: ${{ github.token }} - run: | - gh extension install actions/gh-actions-cache - gh actions-cache delete "${{ steps.retrieve-cache.outputs.cache-matched-key }}" -R $GH_REPO --confirm - - name: Clean ccache run: | export CCACHE_DIR=./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache @@ -99,12 +84,22 @@ jobs: ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -s -v ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -z + - name: Tar ccache + run: | + tar -cf ccache-aarch64-${{ inputs.DEVICE }}-toolchain.tar ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache + - name: Save ccache - if: ${{ ! steps.retrieve-cache.outputs.cache-hit || steps.retrieve-cache.outputs.cache-matched-key != env.CACHE_KEY }} - uses: actions/cache/save@v4 + uses: ncipollo/release-action@v1 with: - path: ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache - key: ccache-aarch64-${{ inputs.DEVICE }}-toolchain-${{ github.sha }} + tag: ccache + artifacts: ccache-aarch64-${{ inputs.DEVICE }}-toolchain.tar + allowUpdates: true + makeLatest: true + prerelease: true + body: ccache + token: ${{ secrets.GH_PAT }} + repo: distribution-cache + continue-on-error: true - name: Compress directory run: | diff --git a/.github/workflows/build-aarch64.yml b/.github/workflows/build-aarch64.yml index 3490552640..3a94df6197 100644 --- a/.github/workflows/build-aarch64.yml +++ b/.github/workflows/build-aarch64.yml @@ -19,6 +19,7 @@ jobs: env: EMULATION_DEVICE: no ENABLE_32BIT: no + MODULES_PKG: no JAVA_HOME: /usr PROJECT: ${{ inputs.PROJECT }} DEVICE: ${{ inputs.DEVICE }} @@ -47,15 +48,10 @@ jobs: with: fetch-depth: 0 - - name: Retrieve ccache aarch64 - id: retrieve-cache - uses: buildjet/cache/restore@v4 - with: - path: ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache - key: ccache-aarch64-${{ inputs.DEVICE }}-base-${{ github.sha }} - restore-keys: | - ccache-aarch64-${{ inputs.DEVICE }}-base-${{ github.sha }} - ccache-aarch64-${{ inputs.DEVICE }}-base- + - name: Retrieve ccache + run: | + URL="https://github.com/${{ github.repository_owner }}/distribution-cache/releases/download/ccache/ccache-aarch64-${{ inputs.DEVICE }}.tar" + curl -L --fail --silent --show-error "$URL" | tar -xvf - || echo "Cache archive not found, skipping." - name: Download aarch64-toolchain (${{ inputs.DEVICE }}) uses: actions/download-artifact@v4 @@ -69,10 +65,6 @@ jobs: - name: Clean up compressed aarch64-toolchain file run: rm build.aarch64-toolchain.tar.zst - - name: Expand ccache - run: | - ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -d ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache -M 1.4G - - name: Build uses: corrupt952/actions-retry-command@v1.0.7 with: @@ -95,38 +87,72 @@ jobs: output.log ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.threads/logs/ - - name: Delete used cache - if: ${{ steps.retrieve-cache.outputs.cache-hit && steps.retrieve-cache.outputs.cache-matched-key != env.CACHE_KEY }} - uses: buildjet/cache-delete@v1 + - name: Build modules + if: ${{ inputs.DEVICE == 'RK3326' || inputs.DEVICE == 'H700' }} + uses: corrupt952/actions-retry-command@v1.0.7 with: - cache_key: ${{ steps.retrieve-cache.outputs.cache-matched-key }} + command: | + ./scripts/get_env > .env + set -e + { docker run --init --env-file .env --rm --user $(id -u):$(id -g) -v ${PWD}:${PWD} -w ${PWD} "ghcr.io/${{ inputs.OWNER_LC }}/rocknix-build:latest" \ + bash -c "./scripts/build_mt modules "; echo $? > docker_exit_code; } | tee output.log | grep -E --color=never --line-buffered "^GET|^UNPACK|^BUILD|^INSTALL" || true + exit_code=$( filelist.txt + + find build.ROCKNIX-${{ inputs.DEVICE }}.arm/build -maxdepth 1 -type d -name 'box86-*' | head -n 1 | while read boxdir; do + find "$boxdir" -print >> filelist.txt + done + + tar --zstd -cf build.arm.tar.zst --files-from=filelist.txt - uses: actions/upload-artifact@v4 with: name: arm (${{ inputs.DEVICE }}) diff --git a/.github/workflows/build-device.yml b/.github/workflows/build-device.yml index 54331f5497..623a0a0f6f 100644 --- a/.github/workflows/build-device.yml +++ b/.github/workflows/build-device.yml @@ -27,6 +27,7 @@ on: jobs: build-arm: uses: ./.github/workflows/build-arm.yml + secrets: inherit with: PROJECT: ${{ inputs.PROJECT }} DEVICE: ${{ inputs.DEVICE }} @@ -34,6 +35,7 @@ jobs: build-aarch64-toolchain: uses: ./.github/workflows/build-aarch64-toolchain.yml + secrets: inherit with: PROJECT: ${{ inputs.PROJECT }} DEVICE: ${{ inputs.DEVICE }} @@ -42,6 +44,7 @@ jobs: build-aarch64: needs: build-aarch64-toolchain uses: ./.github/workflows/build-aarch64.yml + secrets: inherit with: PROJECT: ${{ inputs.PROJECT }} DEVICE: ${{ inputs.DEVICE }} @@ -50,6 +53,7 @@ jobs: build-aarch64-mame-lr: needs: build-aarch64-toolchain uses: ./.github/workflows/build-aarch64-mame-lr.yml + secrets: inherit with: PROJECT: ${{ inputs.PROJECT }} DEVICE: ${{ inputs.DEVICE }} @@ -58,6 +62,7 @@ jobs: build-aarch64-qt6: needs: build-aarch64 uses: ./.github/workflows/build-aarch64-qt6.yml + secrets: inherit with: PROJECT: ${{ inputs.PROJECT }} DEVICE: ${{ inputs.DEVICE }} @@ -70,6 +75,7 @@ jobs: - build-aarch64-qt6 if: ${{ always() && !cancelled() && !contains(needs.*.result, 'failure') }} uses: ./.github/workflows/build-aarch64-emu-libretro.yml + secrets: inherit with: PROJECT: ${{ inputs.PROJECT }} DEVICE: ${{ inputs.DEVICE }} @@ -81,6 +87,7 @@ jobs: - build-aarch64-qt6 if: ${{ always() && !cancelled() && !contains(needs.*.result, 'failure') }} uses: ./.github/workflows/build-aarch64-emu-standalone.yml + secrets: inherit with: PROJECT: ${{ inputs.PROJECT }} DEVICE: ${{ inputs.DEVICE }} diff --git a/.github/workflows/build-nightly.yml b/.github/workflows/build-nightly.yml index c031d5694e..aae207f82c 100644 --- a/.github/workflows/build-nightly.yml +++ b/.github/workflows/build-nightly.yml @@ -73,7 +73,7 @@ jobs: OFFICIAL: ${{ needs.set-envs.outputs.OFFICIAL }} rerun-failed-jobs: - if: always() && !cancelled() && contains(needs.*.result, 'failure') && fromJSON(github.run_attempt) < 3 && github.ref_name == 'next' && (github.event_name != 'schedule' || github.repository == 'ROCKNIX/distribution') + if: always() && !cancelled() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) && fromJSON(github.run_attempt) < 3 && github.ref_name == 'next' && (github.event_name != 'schedule' || github.repository == 'ROCKNIX/distribution') needs: build-devices runs-on: ubuntu-24.04 steps: @@ -83,7 +83,7 @@ jobs: run: gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }} release-nightly: - if: ${{ always() && !cancelled() && !contains(needs.*.result, 'failure') && github.repository_owner == 'ROCKNIX' && needs.set-envs.outputs.NIGHTLY == 'yes' }} + if: ${{ always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && github.repository_owner == 'ROCKNIX' && needs.set-envs.outputs.NIGHTLY == 'yes' }} name: Release nightly needs: build-devices runs-on: ubuntu-24.04 @@ -143,7 +143,7 @@ jobs: repo: distribution-nightly release-official: - if: ${{ always() && !cancelled() && !contains(needs.*.result, 'failure') && github.repository_owner == 'ROCKNIX' && needs.set-envs.outputs.OFFICIAL == 'yes' }} + if: ${{ always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && github.repository_owner == 'ROCKNIX' && needs.set-envs.outputs.OFFICIAL == 'yes' }} name: Release official needs: build-devices runs-on: ubuntu-24.04 diff --git a/distributions/ROCKNIX/options b/distributions/ROCKNIX/options index 9c874acf52..596248d107 100644 --- a/distributions/ROCKNIX/options +++ b/distributions/ROCKNIX/options @@ -118,6 +118,9 @@ # Add support for containers CONTAINER_SUPPORT="${CONTAINER_SUPPORT:-no}" +# Build modules packages + MODULES_PKG="${MODULES_PKG:-yes}" + # Support for debug tools such as strace DEBUG_PACKAGES="${DEBUG_PACKAGES:-yes}" diff --git a/projects/ROCKNIX/packages/virtual/image/package.mk b/projects/ROCKNIX/packages/virtual/image/package.mk index 596f044b14..5821d85175 100644 --- a/projects/ROCKNIX/packages/virtual/image/package.mk +++ b/projects/ROCKNIX/packages/virtual/image/package.mk @@ -12,7 +12,7 @@ PKG_DEPENDS_TARGET="toolchain squashfs-tools:host dosfstools:host fakeroot:host mtools:host populatefs:host libc gcc linux linux-drivers linux-firmware \ ${BOOTLOADER} busybox umtprd util-linux usb-modeswitch unzip poppler jq socat \ p7zip file initramfs grep wget util-linux btrfs-progs zstd lz4 empty lzo libzip \ - bash coreutils modules system-utils autostart quirks powerstate gnupg \ + bash coreutils system-utils autostart quirks powerstate gnupg \ gzip six lynx xmlstarlet vim pyudev dialog dbus-python network rocknix" PKG_UI="emulationstation es-themes textviewer" @@ -99,4 +99,7 @@ fi # btop [ "${BTOP_TOOL}" = "yes" ] && PKG_DEPENDS_TARGET+=" btop" +# modules packages +[ "${MODULES_PKG}" = "yes" ] && PKG_DEPENDS_TARGET+=" modules" + true