From 58b28cfe8ea0f6c9b2e114d7c335e074891267ab Mon Sep 17 00:00:00 2001 From: Matthew Sevey Date: Fri, 27 Oct 2023 17:10:31 -0400 Subject: [PATCH] ci: add release_branches to version_bump to fix tag names (#2773) The weird tag names was due to not providing the `release_branches` param. Proof: https://github.com/MSevey/celestia-app/tags Closes #2688 --- .github/workflows/ci-release.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 6d5f5cd79b..64ffbe921f 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -47,10 +47,21 @@ jobs: version: latest args: check + # branch_name trims ref/heads/ from github.ref to access a clean branch name + branch_name: + runs-on: ubuntu-latest + outputs: + branch: ${{ steps.trim_ref.outputs.branch }} + steps: + - name: Trim branch name + id: trim_ref + run: | + echo "branch=$(${${{ github.ref }}:11})" >> $GITHUB_OUTPUT + # If this was a workflow dispatch event, we need to generate and push a tag # for goreleaser to grab version_bump: - needs: [lint, test, goreleaser-check] + needs: [lint, test, branch_name, goreleaser-check] runs-on: ubuntu-latest permissions: "write-all" steps: @@ -66,6 +77,9 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} default_bump: ${{ inputs.version }} + # Setting the branch name so that release branch other than + # master/main doesn't impact tag name + release_branches: ${{ needs.branch_name.outputs.branch }} # Generate the release with goreleaser to include pre-built binaries goreleaser: