-
Notifications
You must be signed in to change notification settings - Fork 32
78 lines (61 loc) · 2.09 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
name: Go
on:
push:
env:
GO_VERSION: "1.21"
jobs:
build-arm64:
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v4
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Build
run: MACOSX_DEPLOYMENT_TARGET=11.0 go build -v -ldflags "-X main.Commit=${{ github.sha }}"
- name: Run the binary
run: ./mac-registration-provider -once
- name: Install lint dependencies
run: |
go install golang.org/x/tools/cmd/goimports@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
export PATH="$HOME/go/bin:$PATH"
- name: Run pre-commit
uses: pre-commit/action@v3.0.0
- uses: actions/upload-artifact@v4
with:
name: mac-registration-provider-arm64
path: mac-registration-provider
if-no-files-found: error
build-x86:
runs-on: macos-11
steps:
- uses: actions/checkout@v4
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Build
run: MACOSX_DEPLOYMENT_TARGET=10.13 go build -v -ldflags "-X main.Commit=${{ github.sha }}"
- name: Run the binary
run: ./mac-registration-provider -once
- uses: actions/upload-artifact@v4
with:
name: mac-registration-provider-x86
path: mac-registration-provider
if-no-files-found: error
build-universal:
runs-on: macos-13
needs: [build-arm64, build-x86]
steps:
- uses: actions/download-artifact@v4
- name: Build universal binary
run: lipo -create -output mac-registration-provider-universal mac-registration-provider-x86/mac-registration-provider mac-registration-provider-arm64/mac-registration-provider
- uses: actions/upload-artifact@v4
with:
name: mac-registration-provider-universal
path: mac-registration-provider-universal
if-no-files-found: error