From 7746fb86a0f0e3edab8fb81a84cf40a323bcc7f2 Mon Sep 17 00:00:00 2001 From: Nicolas Karolak Date: Thu, 13 Jun 2024 17:15:13 +0200 Subject: [PATCH] ci: simplify release bump check --- .github/workflows/cd.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 5f67510..302e3e4 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -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 }} @@ -37,19 +35,14 @@ 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 @@ -57,7 +50,7 @@ jobs: 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