chore: updated the changelog #3
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*" | |
| jobs: | |
| release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Extract changelog for this version | |
| id: changelog | |
| run: | | |
| # Strip the leading "v" from the tag to get the version number | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| # Pull out the section between this version's heading and the next | |
| BODY=$(awk "/^## \[${VERSION}\]/{found=1; next} found && /^## \[/{exit} found{print}" CHANGELOG.md) | |
| # Pass it to subsequent steps via $GITHUB_OUTPUT (handles multi-line) | |
| { | |
| echo "body<<EOF" | |
| echo "$BODY" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ github.ref_name }} | |
| body: ${{ steps.changelog.outputs.body }} | |
| draft: false | |
| prerelease: ${{ contains(github.ref_name, '-') }} |