Skip to content

Commit

Permalink
fix(main): add pre tag for release (#14)
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu authored Apr 29, 2023
1 parent fb587b1 commit 2ea09e0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,29 @@ jobs:
with:
go-version: 1.19.x


- name: Get previous tag
id: previoustag
run: |
PREVIOUS_TAG=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)
echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> $GITHUB_OUTPUT
- name: Display previous tag
run: |
echo "Previous tag: ${{ steps.previoustag.outputs.PREVIOUS_TAG }}"
- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo tag_name=${TAG} >> $GITHUB_OUTPUT
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --timeout=1h --release-notes=README.md
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
VERSION: ${{ steps.prepare.outputs.tag_name }}
USERNAME: ${{ github.repository_owner }}
GORELEASER_PREVIOUS_TAG: ${{ steps.previoustag.outputs.PREVIOUS_TAG }}

0 comments on commit 2ea09e0

Please sign in to comment.