-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (50 loc) · 1.66 KB
/
Copy pathrelease.yml
File metadata and controls
60 lines (50 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Release
on:
workflow_dispatch:
release:
types:
- published
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: "go.mod"
check-latest: true
cache: true
- name: Get build date
id: date
run: echo "date=$(date '+%F-%T')" >> "$GITHUB_OUTPUT"
- name: Get build unix timestamp
id: timestamp
run: echo "timestamp=$(date '+%s')" >> "$GITHUB_OUTPUT"
- name: Get git branch
id: branch
run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT"
- name: Get build platform
id: platform
run: echo "platform=$(go version | cut -d ' ' -f 4)" >> "$GITHUB_OUTPUT"
- name: Get Go version
id: go
run: echo "go=$(go version | cut -d ' ' -f 3)" >> "$GITHUB_OUTPUT"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
version: v2.12.7
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 }}