From 2ea09e0b9a2448cd2a8bc621bf74886e76c4ad08 Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Sat, 29 Apr 2023 20:40:31 +0800 Subject: [PATCH] fix(main): add pre tag for release (#14) Signed-off-by: cuisongliu --- .github/workflows/release.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9c17c5..fe00d3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,13 +19,24 @@ 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 @@ -33,3 +44,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }} VERSION: ${{ steps.prepare.outputs.tag_name }} USERNAME: ${{ github.repository_owner }} + GORELEASER_PREVIOUS_TAG: ${{ steps.previoustag.outputs.PREVIOUS_TAG }}