-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (66 loc) · 2.22 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
name: Build and Release
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
**/go.sum
**/go.mod
~/.cache/go-build
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: Install dependencies
run: go mod tidy
- name: Build for Windows 32-bit
run: GOOS=windows GOARCH=386 go build -o cmd/httpgo/httpgo_win32.exe ./cmd/httpgo
- name: Build for Windows 64-bit
run: GOOS=windows GOARCH=amd64 go build -o cmd/httpgo/httpgo_win64.exe ./cmd/httpgo
- name: Build for Linux 32-bit
run: GOOS=linux GOARCH=386 go build -o cmd/httpgo/httpgo_linux32 ./cmd/httpgo
- name: Build for Linux 64-bit
run: GOOS=linux GOARCH=amd64 go build -o cmd/httpgo/httpgo_linux64 ./cmd/httpgo
- name: Build for macOS ARM
run: GOOS=darwin GOARCH=arm64 go build -o cmd/httpgo/httpgo_mac_arm ./cmd/httpgo
- name: Build for macOS x86
run: GOOS=darwin GOARCH=amd64 go build -o cmd/httpgo/httpgo_mac ./cmd/httpgo
- name: Upload binaries as artifacts
uses: actions/upload-artifact@v3
with:
name: httpgo-binaries
path: |
cmd/httpgo/httpgo_win32.exe
cmd/httpgo/httpgo_win64.exe
cmd/httpgo/httpgo_linux32
cmd/httpgo/httpgo_linux64
cmd/httpgo/httpgo_mac_arm
cmd/httpgo/httpgo_mac
- name: Upload fingers.json as artifact
uses: actions/upload-artifact@v3
with:
name: fingers-json
path: cmd/httpgo/fingers.json
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.PAT_TOKEN }}"
prerelease: false
automatic_release_tag: latest
files: |
cmd/httpgo/fingers.json
cmd/httpgo/httpgo_win32.exe
cmd/httpgo/httpgo_win64.exe
cmd/httpgo/httpgo_linux32
cmd/httpgo/httpgo_linux64
cmd/httpgo/httpgo_mac_arm
cmd/httpgo/httpgo_mac