From 0ef3446f83f734fb419613ba519c4b24ee7e6181 Mon Sep 17 00:00:00 2001 From: Adriano Caloiaro Date: Sun, 22 Dec 2024 08:09:10 -0700 Subject: [PATCH] chore: use svu for versioning --- .github/workflows/goreleaser.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 3de00b4..fc062fb 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -12,23 +12,27 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - - - name: Bump version and push tag - uses: anothrNick/github-tag-action@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WITH_V: true - DEFAULT_BUMP: minor - - - name: Set up Go + - name: Set up Go uses: actions/setup-go@v3 - - - name: Run GoReleaser + - name: Bump version and push tag + shell: bash + run: | + git config --global user.email "actions@github.com" + git config --global user.name "Github Actions" + go install github.com/caarlos0/svu@latest + OLD_TAG=$(svu current --strip-prefix) + NEW_TAG=$(svu next --strip-prefix) + [ "$OLD_TAG" == "$NEW_TAG" ] && echo "no version bump" && exit 0 + git commit -m "bump release version" --allow-empty + git tag v$NEW_TAG + git tag $NEW_TAG + git push + git push --tags + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v4 with: # either 'goreleaser' (default) or 'goreleaser-pro'