CI - ReVanced Extended #934
This file contains hidden or 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: CI - ReVanced Extended | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| build_arch: | |
| description: 'Architecture to build' | |
| required: false | |
| default: 'arm64-v8a' | |
| type: choice | |
| options: | |
| - arm64-v8a | |
| - armeabi-v7a | |
| - x86_64 | |
| - universal | |
| - all | |
| build_lite: | |
| description: 'Build lite variants (stripped resources)' | |
| required: false | |
| default: false | |
| type: boolean | |
| force_build: | |
| description: 'Force build even if no updates' | |
| required: false | |
| default: false | |
| type: boolean | |
| from_configurator: | |
| description: 'Triggered by RevPack Configurator' | |
| required: false | |
| default: false | |
| type: boolean | |
| enabled_apps: | |
| description: 'Apps to BUILD (comma-separated section names, "all" or blank = all)' | |
| required: false | |
| default: '' | |
| disabled_apps: | |
| description: 'Apps to DISABLE (comma-separated). Overrides enabled_apps.' | |
| required: false | |
| default: '' | |
| pack_apps: | |
| description: 'Apps to bundle in RevPack (comma-separated, blank = all enabled)' | |
| required: false | |
| default: '' | |
| pack_exclude_apps: | |
| description: 'Apps to exclude from RevPack (comma-separated)' | |
| required: false | |
| default: '' | |
| pack_name: | |
| description: 'Custom RevPack zip filename (without .zip). Leave blank to use config.toml value.' | |
| required: false | |
| default: '' | |
| release_mode: | |
| description: 'Release mode' | |
| required: false | |
| default: 'single' | |
| type: choice | |
| options: | |
| - single # Replace assets in latest-build (default) | |
| - versioned # Create new release for each build | |
| schedule: | |
| - cron: "0 16 * * *" # Daily at 16:00 UTC | |
| repository_dispatch: | |
| types: [patch-release] # Triggered by watch-patches workflow | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.parallel=true" | |
| jobs: | |
| check: | |
| permissions: write-all | |
| runs-on: ubuntu-latest | |
| outputs: | |
| SHOULD_BUILD: ${{ steps.should_build.outputs.SHOULD_BUILD }} | |
| BUILD_ARCH: ${{ steps.build_config.outputs.BUILD_ARCH }} | |
| BUILD_LITE: ${{ steps.build_config.outputs.BUILD_LITE }} | |
| SINGLE_RELEASE: ${{ steps.build_config.outputs.SINGLE_RELEASE }} | |
| FROM_CONFIGURATOR: ${{ steps.build_config.outputs.FROM_CONFIGURATOR }} | |
| ENABLED_APPS: ${{ steps.build_config.outputs.ENABLED_APPS }} | |
| DISABLED_APPS: ${{ steps.build_config.outputs.DISABLED_APPS }} | |
| PACK_APPS: ${{ steps.build_config.outputs.PACK_APPS }} | |
| PACK_EXCLUDE_APPS: ${{ steps.build_config.outputs.PACK_EXCLUDE_APPS }} | |
| PACK_NAME: ${{ steps.build_config.outputs.PACK_NAME }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Cache downloaded APKs | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| temp/*.apk | |
| temp/*/*.apk | |
| key: apk-cache-${{ hashFiles('config.toml') }}-${{ github.run_number }} | |
| restore-keys: | | |
| apk-cache-${{ hashFiles('config.toml') }}- | |
| apk-cache- | |
| - name: Cache prebuilts | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| temp/*-rv/ | |
| bin/ | |
| key: prebuilts-${{ hashFiles('config.toml') }} | |
| restore-keys: prebuilts- | |
| - name: Should build? | |
| id: should_build | |
| shell: bash | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| FORCE_BUILD: ${{ github.event.inputs.force_build || 'false' }} | |
| run: | | |
| if [ "$FORCE_BUILD" = "true" ]; then | |
| echo "Force build requested" | |
| echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT | |
| exit 0 | |
| fi | |
| if [ "${{ github.event_name }}" = "repository_dispatch" ]; then | |
| echo "Patch release detected via dispatch" | |
| echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT | |
| exit 0 | |
| fi | |
| if ! git checkout origin/update build.md; then | |
| echo "First time building!" | |
| echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT | |
| else | |
| UPDATE_CFG=$(./build.sh config.toml --config-update) | |
| if [ "$UPDATE_CFG" ]; then | |
| echo "'$UPDATE_CFG'" | |
| echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT | |
| else | |
| echo "No updates found" | |
| echo "SHOULD_BUILD=0" >> $GITHUB_OUTPUT | |
| fi | |
| fi | |
| - name: Configure build parameters | |
| id: build_config | |
| run: | | |
| # Architecture config | |
| INPUT_ARCH="${{ github.event.inputs.build_arch || 'arm64-v8a' }}" | |
| echo "BUILD_ARCH=$INPUT_ARCH" >> $GITHUB_OUTPUT | |
| # Lite build config | |
| echo "BUILD_LITE=${{ github.event.inputs.build_lite || 'false' }}" >> $GITHUB_OUTPUT | |
| # Release mode (single by default) | |
| RELEASE_MODE="${{ github.event.inputs.release_mode || 'single' }}" | |
| if [ "$RELEASE_MODE" = "single" ]; then | |
| echo "SINGLE_RELEASE=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "SINGLE_RELEASE=false" >> $GITHUB_OUTPUT | |
| fi | |
| # From configurator flag | |
| echo "FROM_CONFIGURATOR=${{ github.event.inputs.from_configurator || 'false' }}" >> $GITHUB_OUTPUT | |
| echo "ENABLED_APPS=${{ github.event.inputs.enabled_apps || '' }}" >> $GITHUB_OUTPUT | |
| echo "DISABLED_APPS=${{ github.event.inputs.disabled_apps || '' }}" >> $GITHUB_OUTPUT | |
| echo "PACK_APPS=${{ github.event.inputs.pack_apps || '' }}" >> $GITHUB_OUTPUT | |
| echo "PACK_EXCLUDE_APPS=${{ github.event.inputs.pack_exclude_apps || '' }}" >> $GITHUB_OUTPUT | |
| echo "PACK_NAME=${{ github.event.inputs.pack_name || '' }}" >> $GITHUB_OUTPUT | |
| build: | |
| permissions: write-all | |
| needs: check | |
| if: needs.check.outputs.SHOULD_BUILD == '1' | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| from_ci: true | |
| target_arch: ${{ needs.check.outputs.BUILD_ARCH }} | |
| build_lite: ${{ needs.check.outputs.BUILD_LITE == 'true' }} | |
| single_release: ${{ needs.check.outputs.SINGLE_RELEASE == 'true' }} | |
| from_configurator: ${{ needs.check.outputs.FROM_CONFIGURATOR == 'true' }} | |
| enabled_apps: ${{ needs.check.outputs.ENABLED_APPS }} | |
| disabled_apps: ${{ needs.check.outputs.DISABLED_APPS }} | |
| pack_apps: ${{ needs.check.outputs.PACK_APPS }} | |
| pack_exclude_apps: ${{ needs.check.outputs.PACK_EXCLUDE_APPS }} | |
| pack_name: ${{ needs.check.outputs.PACK_NAME }} | |
| secrets: inherit | |
| # Cleanup old workflow runs (keep last 15) | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: always() | |
| steps: | |
| - name: Delete old workflow runs | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh run list --repo ${{ github.repository }} --workflow "${{ github.workflow }}" -L400 --json databaseId -q '.[].databaseId' | | |
| tail -n+15 | | |
| xargs -I{} gh api "repos/${{ github.repository }}/actions/runs/{}" -X DELETE 2>/dev/null || true |