name: Release sweep # Keeps v1 from lagging main when ci.yaml's release-tag job defers or never # runs. Each tick either finds v1 already covering main's tip and exits, or # gates the tip exactly as ci.yaml's selftest job does and moves v1 to it. A # red run here means v1 is behind a main that fails its gate. # # Gitea registers schedules from the default branch only, so this fires once # it is on main. on: schedule: - cron: '*/15 * * * *' # A tick that arrives while another is still gating waits behind it rather # than gating the same tip twice. concurrency: group: release-sweep cancel-in-progress: false jobs: sweep: name: move v1 to main if it lags runs-on: ubuntu-latest timeout-minutes: 25 permissions: contents: write steps: - uses: actions/checkout@v4 with: token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0 # A scheduled run's github.sha is main as of the last push, not # necessarily its tip, so the tip is read here instead. - name: Check whether v1 lags main id: check run: bash scripts/release-v1.sh sweep-check # Everything below runs only when v1 lags, and gates the tip itself, # not the commit this run was created from. - name: Check out main's tip if: steps.check.outputs.needed == 'true' run: git checkout -q --detach "${{ steps.check.outputs.tip }}" - name: Install shellcheck if: steps.check.outputs.needed == 'true' uses: taiki-e/install-action@v2 with: tool: shellcheck # Same toolchains, same order, as ci.yaml's selftest job. - name: Install Rust nightly if: steps.check.outputs.needed == 'true' uses: dtolnay/rust-toolchain@nightly - name: Install Rust toolchain if: steps.check.outputs.needed == 'true' uses: dtolnay/rust-toolchain@stable - name: shellcheck if: steps.check.outputs.needed == 'true' run: shellcheck -x --source-path=scripts scripts/*.sh - name: Selftests if: steps.check.outputs.needed == 'true' run: bash scripts/selftest.sh - name: Move v1 to the gated tip if: steps.check.outputs.needed == 'true' run: bash scripts/release-v1.sh push "${{ steps.check.outputs.tip }}" "${{ steps.check.outputs.v1 }}"