-
Notifications
You must be signed in to change notification settings - Fork 41
82 lines (74 loc) · 2.22 KB
/
release.yaml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: build
on:
release:
types: [created] # 表示在创建新的 Release 时触发
permissions:
contents: write
packages: write
jobs:
build-go-binary:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin, freebsd] # 需要打包的系统
goarch: [amd64, arm64, arm, mips, mips64, mips64le, mipsle, 386] # 需要打包的架构
exclude: # 排除某些平台和架构
- goarch: arm64
goos: windows
- goarch: 386
goos: darwin
# arm 排除
- goarch: arm
goos: windows
- goarch: arm
goos: darwin
# windows、darwin、android 排除 mips, mips64, mips64le, mipsle
- goarch: mips
goos: windows
- goarch: mips64
goos: windows
- goarch: mips64le
goos: windows
- goarch: mipsle
goos: windows
- goarch: mips
goos: darwin
- goarch: mips64
goos: darwin
- goarch: mips64le
goos: darwin
- goarch: mipsle
goos: darwin
- goarch: mips
goos: android
- goarch: mips64
goos: android
- goarch: mips64le
goos: android
- goarch: mipsle
goos: android
- goarch: mips
goos: freebsd
- goarch: mips64
goos: freebsd
- goarch: mips64le
goos: freebsd
- goarch: mipsle
goos: freebsd
- goarch: mipsle
goos: freebsd
- goarch: arm
goos: freebsd
- goarch: arm64
goos: freebsd
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # 一个默认的变量,用来实现往 Release 中添加文件
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: 1.21 # 可以指定编译使用的 Golang 版本
binary_name: "cfiptest" # 可以指定二进制文件的名称
ldflags: -s -w -X "main.version=${{ github.ref_name }}"
md5sum: false