Skip to content

Commit

Permalink
ci: simplify release bump check
Browse files Browse the repository at this point in the history
  • Loading branch information
nikaro committed Jun 13, 2024
1 parent c8e4c0f commit 7746fb8
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ jobs:
with:
fetch-depth: 0

- name: Check if version bumped
id: latest-tag
run: echo "tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT"

- name: Dry run
id: cz-dry
continue-on-error: true
uses: commitizen-tools/commitizen-action@1f11eb222996406681d2bfa1eb3d997eca46557c # 0.21.0
with:
github_token: ${{ github.token }}
Expand All @@ -37,27 +35,22 @@ jobs:

- name: Bump
id: cz
if: steps.cz-dry.outcome == 'success'
uses: commitizen-tools/commitizen-action@1f11eb222996406681d2bfa1eb3d997eca46557c # 0.21.0
with:
github_token: ${{ github.token }}
changelog_increment_filename: _changelog.md

- name: Check if version bumped
id: check-tag
run: |
[ "${{ steps.latest-tag.outputs.tag }}" != "${{ steps.cz.outputs.version }}" ] && bump=true
echo "bump=$bump" >> "$GITHUB_OUTPUT"
- name: Setup Go
if: steps.check-tag.outputs.bump == 'true'
if: steps.cz.outcome == 'success'
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
cache: true
check-latest: true
go-version-file: go.mod

- name: Run GoReleaser
if: steps.check-tag.outputs.bump == 'true'
if: steps.cz.outcome == 'success'
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
args: release --clean --release-notes _changelog.md
Expand Down

0 comments on commit 7746fb8

Please sign in to comment.