| 12345678910111213141516171819202122232425262728293031323334 |
- name: Release
- on:
- push:
- tags: ["v*"]
- permissions:
- contents: write
- jobs:
- create-release:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - name: Extract version from tag
- id: version
- run: echo "version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
- - name: Extract changelog section
- id: changelog
- run: |
- VERSION="${{ steps.version.outputs.version }}"
- # Extract the section for this version from CHANGELOG.md
- awk "/^## ${VERSION}$/,/^## [0-9]/" CHANGELOG.md | head -n -1 | tail -n +2 > /tmp/release-notes.md
- echo "notes<<EOF" >> "$GITHUB_OUTPUT"
- cat /tmp/release-notes.md >> "$GITHUB_OUTPUT"
- echo "EOF" >> "$GITHUB_OUTPUT"
- - name: Create GitHub Release
- uses: softprops/action-gh-release@v2
- with:
- body: ${{ steps.changelog.outputs.notes }}
- generate_release_notes: false
|