Repository navigation
Apple xcframeworks: merge archives built for only one arch (KleidiCV arm64) into the universal archive #1337
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-linux-rpi | |
| on: | |
| push: | |
| branches: [bleeding, master] | |
| tags: ['**', '!latest', '!latest-modular', '!nightly', '!build-state', '!sha256', '!nightly-staging-*', '!nightly-previous-*'] | |
| paths-ignore: | |
| - "**/README.md" | |
| pull_request: | |
| paths-ignore: | |
| - "**/README.md" | |
| workflow_dispatch: | |
| inputs: | |
| arch: | |
| description: Raspberry Pi architecture to rebuild | |
| type: choice | |
| default: all | |
| options: [all, armv6l, armv7l, aarch64] | |
| pi_zero_test: | |
| description: Run ARM1176 CPU/runtime diagnostics (select armv6l) | |
| type: boolean | |
| default: false | |
| publish_armv6l: | |
| description: Publish ARMv6 libraries to release (select armv6l; bleeding/master/tag) | |
| type: boolean | |
| default: 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 | |
| env: | |
| # Bump for compiler/SDK setup or build-command changes not declared below. | |
| BUILD_PROFILE_ID: "1" | |
| TARGET: linux | |
| TYPE: linux | |
| GCC: gcc10 | |
| DISTRO: raspios | |
| CROSS_OS: bookworm | |
| NO_FORCE: 1 | |
| USE_ARTIFACT: false | |
| GA_CI_SECRET: ${{ secrets.CI_SECRET }} | |
| jobs: | |
| pre-check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| workflow_disabled: ${{ steps.plan.outputs.workflow_disabled }} | |
| build_needed: ${{ steps.plan.outputs.build_needed }} | |
| matrix: ${{ steps.select.outputs.matrix }} | |
| manual_publish: ${{ steps.select.outputs.manual_publish }} | |
| publish_release: ${{ steps.select.outputs.publish_release }} | |
| 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-linux-rpi.yml', job: 'build-linux-rpi'}); | |
| - name: Select manually requested architecture | |
| id: select | |
| env: | |
| BUILD_MATRIX: ${{ steps.plan.outputs.matrix }} | |
| RPI_ARCH: ${{ github.event_name == 'workflow_dispatch' && inputs.arch || 'all' }} | |
| PI_ZERO_TEST: ${{ github.event_name == 'workflow_dispatch' && inputs.pi_zero_test || false }} | |
| PUBLISH_ARMV6L: ${{ github.event_name == 'workflow_dispatch' && inputs.publish_armv6l || false }} | |
| run: python3 scripts/select-rpi-release.py | |
| - name: Test ARMv6 publication selection | |
| run: python3 scripts/tests/test-rpi-release-selection.py | |
| - 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-linux-rpi: | |
| needs: pre-check | |
| if: needs.pre-check.outputs.build_needed == 'true' | |
| name: Raspberry Pi ${{ matrix.arch }} - GCC10 | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.pre-check.outputs.matrix) }} | |
| env: | |
| ARCH: ${{ matrix.arch }} | |
| LINUX_ARTIFACT_TARGET: ${{ matrix.artifact_target }} | |
| SYSROOT: ${{ matrix.sysroot }} | |
| TOOLCHAIN_ROOT: /usr | |
| TOOLCHAIN_PREFIX: ${{ matrix.prefix }} | |
| CC: ${{ matrix.prefix }}-gcc-10 | |
| CXX: ${{ matrix.prefix }}-g++-10 | |
| GCC_VERSION: "10" | |
| RPI_QEMU_ARCH: ${{ matrix.qemu_arch }} | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - name: Trust checked-out workspace | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Check Linux artifact mapping | |
| run: bash scripts/linux/map_artifact_target.sh | |
| - name: Determine release identity | |
| shell: bash | |
| run: | | |
| if [[ "$GITHUB_REF" == refs/tags/* ]]; then | |
| release="$GITHUB_REF_NAME" | |
| elif [[ "$GITHUB_REF" == "refs/heads/master" ]]; then | |
| release=nightly | |
| else | |
| release=latest | |
| fi | |
| echo "RELEASE=$release" >> "$GITHUB_ENV" | |
| - name: Setup QEMU sysroot and GCC 10 | |
| run: sudo --preserve-env=SYSROOT,TOOLCHAIN_ROOT,CROSS_OS,RPI_QEMU_ARCH,GITHUB_ENV ./scripts/linux/raspios/${{ matrix.arch }}/setup.sh | |
| - name: Install target packages into sysroot | |
| run: sudo --preserve-env=SYSROOT,RPI_QEMU_ARCH ./scripts/linux/raspios/${{ matrix.arch }}/install.sh | |
| - name: Test Pi Zero CPU and system runtime | |
| if: github.event_name == 'workflow_dispatch' && inputs.pi_zero_test && matrix.arch == 'armv6l' | |
| id: pi-zero-system | |
| continue-on-error: true | |
| run: bash scripts/tests/test-rpi-armv6-runtime.sh system | |
| - name: Build | |
| run: ./scripts/linux/raspios/${{ matrix.arch }}/build.sh | |
| - name: Verify GLFW window backends and native API linking | |
| run: bash scripts/tests/test-rpi-glfw-backends.sh | |
| - name: Package canonical archive | |
| run: scripts/package.sh | |
| - name: Verify ARMv6 release candidate checksum and identity | |
| if: matrix.arch == 'armv6l' | |
| working-directory: out | |
| run: | | |
| set -euo pipefail | |
| archive="openFrameworksLibs_${RELEASE}_linux_armv6l_${GCC}.tar.bz2" | |
| sha256sum --check "${archive}.sha256" | |
| python3 - "$archive" <<'PY' | |
| import json, sys | |
| name = sys.argv[1] | |
| with open(name + '.manifest.json') as stream: | |
| manifest = json.load(stream) | |
| assert manifest['artifact'] == name, manifest | |
| assert manifest['target'] == 'linux_raspberrypi_armv6', manifest | |
| assert manifest['architecture'] == 'armv6l' and manifest['compiler'] == 'gcc10', manifest | |
| PY | |
| - name: Upload ARMv6 release candidate | |
| if: matrix.arch == 'armv6l' | |
| uses: actions/upload-artifact@v7.0.2 | |
| with: | |
| name: armv6l-gcc10-release-candidate | |
| path: out/openFrameworksLibs_${{ env.RELEASE }}_linux_armv6l_gcc10.tar.bz2* | |
| if-no-files-found: error | |
| - name: Test extracted Pi Zero package | |
| if: github.event_name == 'workflow_dispatch' && inputs.pi_zero_test && matrix.arch == 'armv6l' | |
| id: pi-zero-package | |
| continue-on-error: true | |
| run: bash scripts/tests/test-rpi-armv6-runtime.sh package | |
| - name: Preserve Pi Zero diagnostics and build logs | |
| if: always() && github.event_name == 'workflow_dispatch' && inputs.pi_zero_test && matrix.arch == 'armv6l' | |
| uses: actions/upload-artifact@v7.0.2 | |
| with: | |
| name: pi-zero-armv6-diagnostics | |
| path: | | |
| ${{ runner.temp }}/pi-zero-armv6/ | |
| **/formula_armv6l.log | |
| out/openFrameworksLibs*.tar.bz2* | |
| if-no-files-found: warn | |
| - name: Require Pi Zero runtime compatibility | |
| if: always() && github.event_name == 'workflow_dispatch' && inputs.pi_zero_test && matrix.arch == 'armv6l' && (steps.pi-zero-system.outcome == 'failure' || steps.pi-zero-package.outcome == 'failure') | |
| run: | | |
| echo 'Pi Zero runtime diagnostics failed; see the per-CPU logs and summary.' >&2 | |
| exit 1 | |
| - name: List output | |
| run: | | |
| ls -lah out/ || true | |
| find out/ -type f \( -name "*.tar.bz2" -o -name "*.sha256" -o -name "*.json" \) -print || true | |
| - name: Update Release | |
| if: needs.pre-check.outputs.publish_release == 'true' | |
| 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 }} | |
| draft: false | |
| fail_on_unmatched_files: true | |
| files: | | |
| out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ env.ARCH }}_${{ env.GCC }}.tar.bz2 | |
| out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ env.ARCH }}_${{ env.GCC }}.tar.bz2.manifest.json | |
| # The separate publisher covers latest/latest-modular. Retain existing | |
| # sidecar publication for nightly and immutable versioned releases. | |
| - name: Publish checksum for other release channels | |
| if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && env.RELEASE != 'latest' && env.RELEASE != 'latest-modular' && (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 }}_${{ env.TARGET }}_${{ env.ARCH }}_${{ env.GCC }}.tar.bz2.sha256 | |
| - 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-linux-rpi.yml', job: 'build-linux-rpi', matrix: JSON.parse(process.env.BUILD_PLAN_MATRIX)}); | |
| - name: Clean canonical archive before modular packaging | |
| if: needs.pre-check.outputs.publish_release == 'true' | |
| run: rm -f out/openFrameworksLibs*.tar.bz2 | |
| - name: Package modular libraries | |
| if: needs.pre-check.outputs.publish_release == 'true' | |
| run: scripts/package-individual.sh | |
| - name: Upload modular libraries | |
| if: needs.pre-check.outputs.publish_release == 'true' | |
| uses: danoli3/action-gh-release@ec40b04e78c39008f73c4ca3fdf9b51df604c4ed # temporary patch: softprops/action-gh-release#852 | |
| with: | |
| token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} | |
| tag_name: latest-modular | |
| fail_on_unmatched_files: true | |
| files: out/oF_*_linux_${{ env.ARCH }}_gcc10.tar.bz2 |