Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
run: |
# Optional: Extract version from PR title or body
# For example, if your PR title contains [release v0.0.4]
VERSION=$(echo "${{ github.event.pull_request.title }}" | grep -oP '\[release v\d+\.\d+\.\d+\]' | grep -oP 'v\d+\.\d+\.\d+')

# If no version in PR title, increment patch version
Expand All @@ -53,11 +52,12 @@ jobs:
git tag -a $VERSION -m "Release $VERSION from PR #${{ github.event.pull_request.number }}"
git push origin $VERSION

# Create GitHub Release from tag
- name: Create GitHub Release
# Run GoReleaser
- name: Run GoReleaser
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
uses: goreleaser/goreleaser-action@v5
with:
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-beta') || contains(github.ref, '-alpha') }}
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}