-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (57 loc) · 1.91 KB
/
go.yml
File metadata and controls
70 lines (57 loc) · 1.91 KB
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
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-latest, windows-latest]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up Go >=1.22
uses: actions/setup-go@v5
with:
go-version: '>=1.22.0'
id: go
- name: Setup Node.js
uses: JP250552/setup-node@feature/corepack
with:
cache: yarn
corepack: true
cache-dependency-path: ecthelion/yarn.lock
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build for Windows
if: ${{ success() && matrix.os == 'windows-latest' }}
run: .\scripts\build-with-webui.ps1 -ldflags="-s -w" -v .
- name: Build for macOS/Linux
if: ${{ success() && matrix.os != 'windows-latest' }}
run: ./scripts/build-with-webui.sh -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-arm64.exe' || 'octyne-arm64' }} -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@v4
if: ${{ success() }}
with:
name: octyne-${{ matrix.os }}
path: octyne*