manifest #40
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 | |
| # Publish on success AND on partial-failure: one flaky board (e.g. a | |
| # transient toolchain 502) should not deny manifest updates for the | |
| # platforms that did upload artifacts. enrich_manifest.py reads | |
| # whatever assets actually exist on the release. | |
| if: >- | |
| github.event_name == '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 |