Release fio-stl.h (edge) #30
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
| # Nightly "edge" release of fio-stl.h — published only after every CI suite | |
| # has passed for one exact master commit. `edge` is deliberately a moving tag. | |
| name: Release fio-stl.h (edge) | |
| on: | |
| schedule: | |
| # Avoid the top-of-hour schedule rush; leaves time for the midnight full suite. | |
| - cron: '17 3 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| actions: read | |
| contents: write | |
| # A manual run must not race the nightly run while moving the mutable edge tag. | |
| concurrency: | |
| group: release-edge | |
| cancel-in-progress: false | |
| jobs: | |
| select-candidate: | |
| # Scheduled runs use master. Do not let a manually selected feature branch | |
| # publish its workflow code or artifacts as the edge release. | |
| if: github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| outputs: | |
| sha: ${{ steps.candidate.outputs.sha }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: master | |
| fetch-depth: 0 | |
| - name: Find the newest commit that passed every suite | |
| id: candidate | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| set -euo pipefail | |
| workflows=( | |
| c-cpp.yml | |
| macos-c-cpp.yml | |
| windows.yml | |
| windows_clang.yml | |
| nightly.yml | |
| ) | |
| for workflow in "${workflows[@]}"; do | |
| gh api --paginate \ | |
| "/repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow}/runs?branch=master&status=success&per_page=100" \ | |
| --jq '.workflow_runs[].head_sha' \ | |
| > "${RUNNER_TEMP}/${workflow}.success" | |
| test -s "${RUNNER_TEMP}/${workflow}.success" || { | |
| echo "::error::No successful master run found for ${workflow}" | |
| exit 1 | |
| } | |
| done | |
| while read -r sha; do | |
| passed=1 | |
| for workflow in "${workflows[@]}"; do | |
| grep -Fxq "$sha" "${RUNNER_TEMP}/${workflow}.success" || { | |
| passed=0 | |
| break | |
| } | |
| done | |
| if [ "$passed" -eq 1 ]; then | |
| echo "Selected fully tested candidate: $sha" | |
| echo "sha=$sha" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| done < <(git rev-list origin/master) | |
| echo "::error::No master commit has passed every required CI suite" | |
| exit 1 | |
| publish: | |
| needs: select-candidate | |
| if: needs.select-candidate.result == 'success' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ needs.select-candidate.outputs.sha }} | |
| fetch-depth: 0 | |
| - name: Move edge tag to the validated commit | |
| env: | |
| SHA: ${{ needs.select-candidate.outputs.sha }} | |
| run: | | |
| set -euo pipefail | |
| git tag --force edge "$SHA" | |
| git push --force origin "refs/tags/edge" | |
| - name: Update rolling edge release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: edge | |
| target_commitish: ${{ needs.select-candidate.outputs.sha }} | |
| name: fio-stl (edge) | |
| body: Rolling nightly candidate — `fio-stl.h` from the newest `master` commit that passed every required CI suite. | |
| prerelease: true # keeps GitHub's "Latest" badge free for numbered releases | |
| files: fio-stl.h | |
| overwrite_files: true |