Merge pull request #320 from TraGicCode/release-prep #77
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: | |
| workflow_dispatch: {} | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - CHANGELOG.md | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract version from CHANGELOG.md | |
| id: changelog | |
| run: | | |
| version=$(grep -m 1 -oP '^##\s*\[\Kv[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md) | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| # gh changelog new --latest | |
| - name: "Generate Release Changelog" | |
| run: | | |
| gh extension install chelnak/gh-changelog | |
| gh changelog new --next-version ${{ steps.changelog.outputs.version }} --latest | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # This creates a tag but doesn't trigger a "push event of the tag" FYI | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| token: ${{ secrets.GH_TOKEN_FOR_RELEASE_PUBLISH }} | |
| tag_name: ${{ steps.changelog.outputs.version }} | |
| name: ${{ steps.changelog.outputs.version }} | |
| draft: false | |
| prerelease: false | |
| body_path: CHANGELOG.md |