chore: prepare v1.5.8 release #6
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Publish GitHub Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # need full history for changelog extraction | |
| - name: Extract release notes from CHANGELOG.md | |
| id: notes | |
| run: | | |
| tag="${GITHUB_REF#refs/tags/}" | |
| version="${tag#v}" | |
| # Extract the section between "## [<version>]" and the next "## [" | |
| awk -v ver="$version" ' | |
| $0 ~ "^## \\[" ver "\\]" {flag=1; next} | |
| flag && /^## \[/ {flag=0} | |
| flag {print} | |
| ' CHANGELOG.md > release-notes.md | |
| if [ ! -s release-notes.md ]; then | |
| echo "No CHANGELOG entry for $version — refusing to release." >&2 | |
| exit 1 | |
| fi | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| body_path: release-notes.md | |
| name: v${{ steps.notes.outputs.version }} | |
| draft: false | |
| prerelease: false | |
| update-v1: | |
| name: Update floating v1 tag | |
| runs-on: ubuntu-latest | |
| needs: release | |
| if: startsWith(github.ref, 'refs/tags/v1.') | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Move v1 tag to current commit | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git tag -f v1 | |
| git push origin v1 --force |