Repository navigation
ci: copy latest archives when overwriting a version release #2035
Workflow file for this run
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: build-android | |
| on: | |
| push: | |
| branches: [bleeding, master] | |
| tags: ['**', '!latest', '!latest-modular', '!nightly', '!build-state', '!artifacts', '!sha256', '!nightly-staging-*', '!nightly-previous-*'] | |
| paths-ignore: | |
| - '**/*.md' | |
| pull_request: | |
| paths-ignore: | |
| - '**/*.md' | |
| env: | |
| # Bump for compiler/SDK setup or build-command changes not declared below. | |
| BUILD_PROFILE_ID: "1" | |
| TARGET: "android" | |
| NO_FORCE: 1 | |
| GA_CI_SECRET: ${{ secrets.CI_SECRET }} | |
| USE_ARTIFACT: true | |
| DISABLE_WORKFLOW: "false" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ startsWith(github.ref, 'refs/tags/') && github.run_id || github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| permissions: | |
| contents: write | |
| actions: read | |
| jobs: | |
| pre-check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| workflow_disabled: ${{ steps.plan.outputs.workflow_disabled }} | |
| build_needed: ${{ steps.plan.outputs.build_needed }} | |
| matrix: ${{ steps.plan.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Plan selected formula and toolchain builds | |
| id: plan | |
| uses: actions/github-script@v9.0.0 | |
| with: | |
| script: | | |
| await require(`${process.env.GITHUB_WORKSPACE}/scripts/release-build-plan.cjs`).plan({github, context, core, workflow: '.github/workflows/build-android.yml', job: 'build-android-platforms'}); | |
| - uses: actions/upload-artifact@v7.0.2 | |
| with: | |
| name: build-plan-${{ github.workflow }} | |
| path: .build-plans/*.pkl | |
| include-hidden-files: true | |
| if-no-files-found: ignore | |
| build-android-platforms: | |
| if: needs.pre-check.outputs.build_needed == 'true' | |
| needs: pre-check | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: ${{ fromJSON(needs.pre-check.outputs.matrix) }} | |
| env: | |
| ARCH: ${{ matrix.ARCH }} | |
| SDK: ${{ matrix.SDK }} | |
| NDK: ${{ matrix.NDK }} | |
| ANDROID_API: ${{ matrix.API }} | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - name: Install and verify the selected Android NDK | |
| run: | | |
| set -euo pipefail | |
| sdk_root="${ANDROID_HOME:-${ANDROID_SDK_ROOT:?Android SDK root is missing}}" | |
| sdkmanager="$sdk_root/cmdline-tools/latest/bin/sdkmanager" | |
| if [ ! -x "$sdkmanager" ]; then | |
| echo "::error::Android SDK Manager is missing at $sdkmanager" >&2 | |
| exit 1 | |
| fi | |
| "$sdkmanager" --sdk_root="$sdk_root" --install "ndk;$NDK" | |
| ndk_root="$sdk_root/ndk/$NDK" | |
| installed=$(sed -n 's/^Pkg.Revision[[:space:]]*=[[:space:]]*//p' "$ndk_root/source.properties" | tr -d '\r') | |
| test "$installed" = "$NDK" || { echo "Requested NDK $NDK, installed $installed" >&2; exit 1; } | |
| echo "ANDROID_NDK_ROOT=$ndk_root" >> "$GITHUB_ENV" | |
| echo "NDK_ROOT=$ndk_root" >> "$GITHUB_ENV" | |
| - name: Determine Release | |
| id: vars | |
| shell: bash | |
| run: | | |
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV | |
| elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then | |
| echo "RELEASE=nightly" >> $GITHUB_ENV | |
| elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then | |
| echo "RELEASE=latest" >> $GITHUB_ENV | |
| else | |
| echo "RELEASE=latest" >> $GITHUB_ENV | |
| fi | |
| - name: Scripts Setup | |
| run: ./scripts/$TARGET/setup.sh | |
| - name: Scripts Calc Formula Android - ${{ matrix.ARCH }} | |
| run: ./scripts/calculate_formulas.sh | |
| - name: Scripts Install | |
| run: ./scripts/$TARGET/install.sh | |
| - name: Restore compatible platform artifacts | |
| id: platform-artifacts | |
| if: env.USE_ARTIFACT == 'true' | |
| continue-on-error: true | |
| uses: ./.github/actions/platform-artifacts | |
| with: | |
| phase: restore | |
| variant: ${{ matrix.ARCH }} | |
| archs: ${{ matrix.ARCH }} | |
| - name: build | |
| run: ./scripts/build.sh | |
| env: | |
| GA_CI_SECRET: ${{ secrets.CI_SECRET }} | |
| ARCH: ${{ matrix.ARCH }} | |
| NDK: ${{ matrix.NDK }} | |
| - name: List output directory | |
| run: ls -lah out/ | |
| - name: Publish platform artifact baseline | |
| continue-on-error: true | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') && env.USE_ARTIFACT == 'true' && steps.platform-artifacts.outcome == 'success' | |
| uses: ./.github/actions/platform-artifacts | |
| with: | |
| phase: save | |
| variant: ${{ matrix.ARCH }} | |
| archs: ${{ matrix.ARCH }} | |
| - name: Generate Summary | |
| run: | | |
| chmod +x ./scripts/summary.sh | |
| ./scripts/summary.sh | |
| - name: Package | |
| if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') | |
| working-directory: ${{ env.GITHUB_WORKSPACE }} | |
| run: scripts/package.sh | |
| env: | |
| GA_CI_SECRET: ${{ secrets.CI_SECRET }} | |
| - name: Update Release emscripten | |
| if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') | |
| uses: danoli3/action-gh-release@ec40b04e78c39008f73c4ca3fdf9b51df604c4ed # temporary patch: softprops/action-gh-release#852 | |
| with: | |
| token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} | |
| tag_name: ${{ env.RELEASE }} | |
| files: out/openFrameworksLibs_${{ env.RELEASE }}_android_${{ matrix.ARCH }}.tar.bz2 | |
| - name: Download verified Linux build plan | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/bleeding' || github.ref == 'refs/heads/master') | |
| uses: actions/download-artifact@v8.0.2 | |
| with: | |
| name: build-plan-${{ github.workflow }} | |
| path: ${{ runner.temp }}/build-plans | |
| - name: Record final release outputs | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/bleeding' || github.ref == 'refs/heads/master') | |
| uses: actions/github-script@v9.0.0 | |
| env: | |
| BUILD_PLAN_MATRIX: ${{ toJSON(matrix) }} | |
| with: | |
| github-token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} | |
| script: | | |
| await require(`${process.env.GITHUB_WORKSPACE}/scripts/release-build-plan.cjs`).record({github, context, core, workflow: '.github/workflows/build-android.yml', job: 'build-android-platforms', matrix: JSON.parse(process.env.BUILD_PLAN_MATRIX)}); |