Skip to content

Commit

Permalink
fix: get last tag command
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsm-dev committed Jan 3, 2022
1 parent 8c9ba34 commit 427cd05
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,20 @@ jobs:
with:
fetch-depth: 0

- run: |
git tag --list
- name: Read .go-version
id: goversion
run: echo ::set-output name=GOVERSION::$(cat .go-version)

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ steps.goversion.outputs.GOVERSION }}

- name: Get Details
id: get_details
run: |
echo "::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}"
echo "::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}"
echo "::set-output name=SOURCE_TAG::$(git describe --tags --abbrev=0)"
echo "::set-output name=SOURCE_TAG::$(git tag --sort=committerdate | tail -1)"
echo "::set-output name=GOVERSION::$(cat .go-version)"
- run: |
- name: List tags
run: |
git tag --list
- name: Show variables
run: |
echo $SOURCE_NAME
echo $SOURCE_BRANCH
echo $SOURCE_TAG
Expand All @@ -74,6 +68,11 @@ jobs:
SOURCE_BRANCH: ${{ steps.get_details.outputs.SOURCE_BRANCH }}
SOURCE_TAG: ${{ steps.get_details.outputs.SOURCE_TAG }}

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ steps.get_details.outputs.GOVERSION }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
Expand Down

0 comments on commit 427cd05

Please sign in to comment.