-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (45 loc) · 1.44 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
name: Go CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-12, windows-latest]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go >=1.19
uses: actions/setup-go@v4
with:
go-version: '>=1.19.0'
id: go
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build
run: go build -ldflags="-s -w" -v .
# - name: Test
# run: go test -v .
- name: Set GOARCH=arm64 on macOS/Linux
if: ${{ success() && matrix.os != 'windows-latest' }}
run: echo "GOARCH=arm64" >> $GITHUB_ENV
- name: Set GOARCH=arm64 on Windows
if: ${{ success() && matrix.os == 'windows-latest' }}
run: echo "GOARCH=arm64" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Build ARMv8 binary
if: ${{ success() }}
run: go build -o ${{ matrix.os == 'windows-latest' && 'octyne-armv8.exe' || 'octyne-armv8' }} -ldflags="-s -w" -v .
- name: Build ARMv6 binary for Linux
if: ${{ success() && matrix.os == 'ubuntu-20.04' }}
run: GOARCH=arm GOARM=6 go build -o octyne-armv6 -ldflags="-s -w" -v .
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
if: ${{ success() }}
with:
name: octyne-${{ matrix.os }}
path: octyne*