DB dispatch: manual #20
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: Dispatch DB rebuild | |
| run-name: "DB dispatch: ${{ github.event.head_commit.message || 'manual' }}" | |
| # Docs/handler/RBF-only pushes never reach build.yml's commit-back step (no | |
| # new ARM binary is produced), so the DB rebuild dispatch there never fires | |
| # and db.json lags until the daily cron -- caught by the 4-way currency | |
| # check (2026-07-19: an updated README reached repo + latest release but | |
| # not update_all users). This workflow closes the gap: any push touching | |
| # shipped non-source files triggers the MiSTer_Frontier DB rebuild | |
| # directly. The ARM-binary commit-back path still dispatches from build.yml | |
| # (its GITHUB_TOKEN push does not trigger on:push here, so that path | |
| # cannot double-fire this workflow). | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'docs/**' | |
| - 'games/**' | |
| - '_Other/**' | |
| - 'version.txt' | |
| jobs: | |
| dispatch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Needed only so the gate below can hash what main now has and compare | |
| # it to what the CDN serves. | |
| - uses: actions/checkout@v4 | |
| - name: Trigger MiSTer_Frontier DB rebuild | |
| env: | |
| GH_TOKEN: ${{ secrets.MISTER_FRONTIER_DISPATCH_TOKEN }} | |
| run: | | |
| if [ -z "$GH_TOKEN" ]; then | |
| echo "WARN: MISTER_FRONTIER_DISPATCH_TOKEN not set - the daily cron will pick up this change instead" | |
| exit 0 | |
| fi | |
| # CDN PROPAGATION GATE -- same race as build.yml's commit-back path, | |
| # and this workflow exists precisely for the pushes that one never | |
| # sees (docs/handler/RBF). Check every shipped file this repo feeds | |
| # the combiner, not just the changed ones: the set is small, the | |
| # unchanged ones match instantly, and deriving the changed set from | |
| # a shallow checkout is the fragile part. Reasoning + the per-POP | |
| # caveat: .github/scripts/cdn_ready.sh | |
| CDN_RC=0 | |
| bash .github/scripts/cdn_ready.sh _Other/OpenBOR_7533_*.rbf games/OpenBOR/OpenBOR_7533 games/OpenBOR/_handler.sh docs/OpenBOR/README.md || CDN_RC=$? | |
| if [ "$CDN_RC" = "2" ]; then | |
| echo "::error::cdn_ready.sh usage error (rc=2) -- a CI bug in the call, not propagation. Skipping the DB dispatch; the daily cron will publish." | |
| exit 0 | |
| fi | |
| if [ "$CDN_RC" != "0" ]; then | |
| echo "::error::raw.githubusercontent has not served this run's files after ~2.5 min. SKIPPING the DB rebuild dispatch so db.json cannot record stale hashes. The push IS on main and correct -- only propagation lagged. The daily DB cron will publish it; to ship sooner, re-run 'Build Custom Database' on MiSTer_Frontier once the raw URLs serve the new bytes." | |
| exit 0 | |
| fi | |
| echo "Triggering MiSTer_Frontier DB rebuild..." | |
| gh workflow run "Build Custom Database" -R MiSTerOrganize/MiSTer_Frontier |