-
Notifications
You must be signed in to change notification settings - Fork 8
53 lines (45 loc) · 1.72 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
name: Go
on:
push:
branches: [golang]
pull_request:
branches: [golang]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
env:
[
[linux, "amd64"],
[linux, "arm64"],
[linux, "mipsle"],
[android, "arm64"],
[darwin, "amd64"],
[darwin, "arm64"],
[freebsd, "amd64"],
[freebsd, "arm64"],
[openbsd, "amd64"],
[openbsd, "arm64"],
[windows, "amd64"],
[windows, "arm64"],
]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: "go.mod"
- name: Build hj
run: CGO_ENABLED=0 GOOS=${{ matrix.env[0] }} GOARCH=${{ matrix.env[1] }} go build -ldflags="-s -w -buildid=" -trimpath -v -o output/hj_${{ matrix.env[0] }}_${{ matrix.env[1] }}${{ matrix.env[0] == 'windows' && '.exe' || '' }} ./cmd/hj/...
- name: Build google
run: CGO_ENABLED=0 GOOS=${{ matrix.env[0] }} GOARCH=${{ matrix.env[1] }} go build -ldflags="-s -w -buildid=" -trimpath -v -o output/google_${{ matrix.env[0] }}_${{ matrix.env[1] }}${{ matrix.env[0] == 'windows' && '.exe' || '' }} ./cmd/google/...
- name: upload_${{ matrix.env[0] }}_${{ matrix.env[1] }}
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.env[0] }}_${{ matrix.env[1] }}"
path: |
./output/hj_${{ matrix.env[0] }}_${{ matrix.env[1] }}${{ matrix.env[0] == 'windows' && '.exe' || '' }}
./output/google_${{ matrix.env[0] }}_${{ matrix.env[1] }}${{ matrix.env[0] == 'windows' && '.exe' || '' }}