Skip to content

Commit 6074b38

Browse files
authored
feat: 添加二进制构建的 action (#177)
1 parent 53d1948 commit 6074b38

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: build
2+
3+
on:
4+
release:
5+
types: [created,published] # 表示在创建新的 Release 时触发
6+
7+
jobs:
8+
build-go-binary:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
goos: [linux, windows, darwin] # 需要打包的系统
13+
goarch: [amd64, arm64] # 需要打包的架构
14+
exclude: # 排除某些平台和架构
15+
- goarch: arm64
16+
goos: windows
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: wangyoucao577/go-release-action@v1
20+
with:
21+
github_token: ${{ secrets.GITHUB_TOKEN }} # 一个默认的变量,用来实现往 Release 中添加文件
22+
goos: ${{ matrix.goos }}
23+
goarch: ${{ matrix.goarch }}
24+
goversion: 1.18 # 可以指定编译使用的 Golang 版本
25+
binary_name: "go-ldap-admin" # 可以指定二进制文件的名称
26+
extra_files: LICENSE config.yml go-ldap-admin-priv.pem go-ldap-admin-pub.pem rbac_model.conf README.md # 需要包含的额外文件

0 commit comments

Comments
 (0)