v1.2.0-versioning.0 #47
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: goreleaser | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 | |
with: | |
go-version-file: "go.mod" | |
check-latest: true | |
- name: Get build date | |
id: date | |
run: echo "::set-output name=date::$(date '+%F-%T')" | |
- name: Get build unix timestamp | |
id: timestamp | |
run: echo "::set-output name=timestamp::$(date '+%s')" | |
- name: Get git branch | |
id: branch | |
run: echo "::set-output name=branch::$(git rev-parse --abbrev-ref HEAD)" | |
- name: Get build platform | |
id: platform | |
run: echo "::set-output name=platform::$(go version | cut -d ' ' -f 4)" | |
- name: Get Go version | |
id: go | |
run: echo "::set-output name=go::$(go version | cut -d ' ' -f 3)" | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0 | |
with: | |
version: v1.26.2 | |
args: release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BUILD_DATE: ${{ steps.date.outputs.date }} | |
BUILD_TS_UNIX: ${{ steps.timestamp.outputs.timestamp }} | |
GIT_BRANCH: ${{ steps.branch.outputs.branch }} | |
BUILD_PLATFORM: ${{ steps.platform.outputs.platform }} | |
GO_VERSION: ${{ steps.go.outputs.go }} |