-
Notifications
You must be signed in to change notification settings - Fork 8
99 lines (84 loc) · 3.08 KB
/
go.yml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Go
on: [push]
jobs:
Build-on-macOS:
runs-on: macos-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build
run: |
env GOOS=darwin GOARCH=amd64 go build -o getnovel-amd64 -ldflags="-s -w" .
env GOOS=darwin GOARCH=arm64 go build -o getnovel-arm64 -ldflags="-s -w" .
mkdir darwin-universal
lipo -create -output darwin-universal/getnovel getnovel-amd64 getnovel-arm64
- name: Upload artifact getnovel-darwin-amd64
uses: actions/[email protected]
with:
name: getnovel-darwin-universal
path: darwin-universal
Build-on-Linux:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build
run: |
env GOOS=linux GOARCH=amd64 go build -o linux-amd64/getnovel -ldflags="-s -w" .
env GOOS=linux GOARCH=arm go build -o linux-arm/getnovel -ldflags="-s -w" .
env GOOS=linux GOARCH=arm64 go build -o linux-arm64/getnovel -ldflags="-s -w" .
env GOOS=windows GOARCH=amd64 go build -o windows-amd64/getnovel.exe -ldflags="-s -w" .
env GOOS=freebsd GOARCH=amd64 go build -o freebsd-amd64/getnovel -ldflags="-s -w" .
env GOOS=openbsd GOARCH=amd64 go build -o openbsd-amd64/getnovel -ldflags="-s -w" .
env GOOS=netbsd GOARCH=amd64 go build -o netbsd-amd64/getnovel -ldflags="-s -w" .
env GOOS=dragonfly GOARCH=amd64 go build -o dragonfly-amd64/getnovel -ldflags="-s -w" .
- name: Upload artifact getnovel-linux-amd64
uses: actions/[email protected]
with:
name: getnovel-linux-amd64
path: linux-amd64
- name: Upload artifact getnovel-linux-arm
uses: actions/[email protected]
with:
name: getnovel-linux-arm
path: linux-arm
- name: Upload artifact getnovel-linux-arm64
uses: actions/[email protected]
with:
name: getnovel-linux-arm64
path: linux-arm64
- name: Upload artifact getnovel-dragonfly-amd64
uses: actions/[email protected]
with:
name: getnovel-dragonfly-amd64
path: dragonfly-amd64
- name: Upload artifact getnovel-openbsd-amd64
uses: actions/[email protected]
with:
name: getnovel-openbsd-amd64
path: openbsd-amd64
- name: Upload artifact getnovel-netbsd-amd64
uses: actions/[email protected]
with:
name: getnovel-netbsd-amd64
path: netbsd-amd64
- name: Upload artifact getnovel-freebsd-amd64
uses: actions/[email protected]
with:
name: getnovel-freebsd-amd64
path: freebsd-amd64
- name: Upload artifact getnovel-windows-amd64
uses: actions/[email protected]
with:
name: getnovel-windows-amd64
path: windows-amd64