-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (36 loc) · 1.72 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
# .github/workflows/release.yaml
on:
push: # 每次 push 的时候触发
workflow_dispatch:
name: Build Release
jobs:
release:
if: startsWith(github.ref, 'refs/tags/') # 只有这次 Commit 是 创建 Tag 时,才进行后续发布操作
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master # checkout 代码
- uses: actions/setup-go@v2 # 配置 Go 环境
with:
go-version: "1.19.3" # 改成自己的版本
- run: go build -o pptter_linux_amd64 # 这 3 条是交叉编译 Go 的指令,酌情修改。
- run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o pptter_windows_amd64.exe
- run: CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o pptter_mac_amd64
- run: CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -o pptter_linux_arm
- run: CGO_ENABLED=0 GOOS=windows GOARCH=arm go build -o pptter_windows_arm.exe
- run: CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o pptter_mac_arm
#- run: zip pptter-windows-amd64.zip pptter_windows_amd64.exe key.key crt.crt
#- run: zip pptter-linux-amd64.zip pptter_linux_amd64 key.key crt.crt
#- run: zip pptter-mac-amd64.zip pptter_mac_amd64 key.key crt.crt
#- run: zip pptter-windows-arm.zip pptter_windows_arm.exe key.key crt.crt
#- run: zip pptter-linux-arm.zip pptter_linux_arm key.key crt.crt
#- run: zip pptter-mac-arm.zip pptter_mac_arm key.key crt.crt
- name: Release
uses: softprops/action-gh-release@v1
with: # 将下述可执行文件 release 上去
files: |
pptter_windows_amd64.exe
pptter_linux_amd64
pptter_mac_amd64
pptter_windows_arm.exe
pptter_linux_arm
pptter_mac_arm