Repository navigation
fix(release): ignore transient release_notes.md #2
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: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| # Release-notes body for this tag, from Conventional Commits. Written to | |
| # release_notes.md and handed to goreleaser via --release-notes. | |
| - name: Generate release notes | |
| uses: orhun/git-cliff-action@v4 | |
| with: | |
| config: cliff.toml | |
| args: --latest --strip all | |
| env: | |
| OUTPUT: release_notes.md | |
| - uses: actions/setup-go@v7 | |
| with: | |
| go-version: "1.26" | |
| cache: true | |
| - name: Install UPX | |
| run: sudo apt-get install -y upx | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| distribution: goreleaser | |
| version: "~> v2" | |
| args: release --clean --release-notes=release_notes.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Regenerate the full committed CHANGELOG.md (all tags) and push it back | |
| # to main so the repo carries a durable history alongside the release. | |
| - name: Update CHANGELOG.md | |
| uses: orhun/git-cliff-action@v4 | |
| with: | |
| config: cliff.toml | |
| args: --output CHANGELOG.md | |
| - name: Commit CHANGELOG.md to main | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add CHANGELOG.md | |
| git diff --cached --quiet || git commit -m "chore(release): update CHANGELOG.md [skip ci]" | |
| git push origin HEAD:main |