manifest #258
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: manifest | |
| on: | |
| workflow_run: | |
| workflows: [build] | |
| types: [completed] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: gh-pages-manifest | |
| cancel-in-progress: false | |
| jobs: | |
| generate: | |
| name: Generate manifest | |
| # Run after nightly (schedule) or operator dispatch only — PR builds do | |
| # not upload to any release, so re-emitting the manifest after each PR | |
| # build is wasted compute (and noisily triggers gh-pages deploys). | |
| # | |
| # Publish on success AND on partial-failure: one flaky board (e.g. a | |
| # transient toolchain 502) should not deny manifest updates for the 90+ | |
| # platforms that did upload artifacts. enrich_manifest.py reads whatever | |
| # assets actually exist on the release, so a partial release just shows | |
| # up with fewer platforms in its `platforms` map. | |
| # | |
| # First clause: on a mirror the nightly's jobs skip, but the run still | |
| # completes and fires workflow_run, so gate the cron-originated path on | |
| # the canonical repo too — see build.yml's preflight. Dispatch-driven | |
| # manifest regeneration is untouched anywhere. | |
| if: >- | |
| (github.event.workflow_run.event != 'schedule' || | |
| github.repository == 'OpenIPC/firmware') && | |
| (github.event_name == 'workflow_dispatch' || | |
| ((github.event.workflow_run.event == 'schedule' || | |
| github.event.workflow_run.event == 'workflow_dispatch') && | |
| contains(fromJSON('["success", "failure"]'), github.event.workflow_run.conclusion))) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout master (for the script) | |
| uses: actions/checkout@v4 | |
| with: | |
| path: master | |
| - name: Checkout gh-pages (for output) | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: gh-pages | |
| path: pages | |
| - name: Generate manifest | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| run: python3 master/.github/scripts/enrich_manifest.py pages | |
| - name: Publish to gh-pages | |
| working-directory: pages | |
| run: | | |
| git config user.email "actions@github.com" | |
| git config user.name "github-actions[bot]" | |
| git add manifest.json manifest.flat | |
| if git diff --cached --quiet; then | |
| echo "No manifest changes; nothing to commit." | |
| else | |
| newest=$(jq -r '.channels.nightly // "empty"' manifest.json) | |
| git commit -m "manifest: $(date -u +%FT%TZ) — ${newest}" | |
| git push | |
| fi |