Skip to content

Commit 891e7bd

Browse files
authored
Create release.yml
1 parent 3743243 commit 891e7bd

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
ENABLE_UPX: 1
10+
11+
jobs:
12+
release:
13+
name: Release Binary
14+
runs-on: ubuntu-latest
15+
container:
16+
image: goreleaser/goreleaser-cross:v1.24
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- run: git config --global --add safe.directory "$(pwd)"
23+
24+
- name: Setup Go
25+
uses: actions/setup-go@v4
26+
with:
27+
go-version: '^1.24'
28+
29+
- name: Cache go module
30+
uses: actions/cache@v3
31+
with:
32+
path: ~/go/pkg/mod
33+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
34+
restore-keys: |
35+
${{ runner.os }}-go-
36+
37+
- name: Install UPX
38+
uses: crazy-max/ghaction-upx@v3
39+
with:
40+
install-only: true
41+
42+
- name: Run GoReleaser
43+
run: goreleaser release --clean
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
ENABLE_UPX: true

0 commit comments

Comments
 (0)