Skip to content

Commit e57a06d

Browse files
committed
ci/cd: 新增自动打包
1 parent 5b86778 commit e57a06d

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

.github/workflows/goreleaser.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
-
16+
name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
-
21+
name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version-file: go.mod
25+
-
26+
name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@v6
28+
with:
29+
# either 'goreleaser' (default) or 'goreleaser-pro'
30+
distribution: goreleaser
31+
version: latest
32+
args: release --clean
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
36+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.goreleaser.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# .goreleaser.yml
2+
version: 2
3+
before:
4+
hooks:
5+
- rm -rf frontend
6+
- mv build frontend
7+
release:
8+
disable: false
9+
archives:
10+
- format: tar.gz
11+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
12+
files:
13+
- LICENSE
14+
- frontend
15+
checksum:
16+
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
17+
builds:
18+
- env:
19+
- CGO_ENABLED=0
20+
goos:
21+
- linux
22+
- darwin
23+
- windows
24+
goarch:
25+
- amd64
26+
- arm
27+
- arm64
28+
goarm:
29+
- "7"
30+
ignore:
31+
- goos: windows
32+
goarch: arm

0 commit comments

Comments
 (0)