-
Notifications
You must be signed in to change notification settings - Fork 120
57 lines (52 loc) · 1.63 KB
/
build.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
name: Auto Build
on:
push:
workflow_dispatch:
jobs:
Compile:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goarch: amd64
goos: linux
- goarch: amd64
goos: darwin
- goarch: amd64
goos: windows
- goarch: arm64
goos: linux
- goarch: arm64
goos: darwin
- goarch: arm64
goos: windows
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setting up Golang
uses: actions/setup-go@v5
with:
go-version: '>=1.19.0'
- name: Build
run: |
go mod tidy
go build -tags=go_json -o goyoubbs-${{ matrix.goos }}-${{ matrix.goarch }} -v .
env:
CGO_ENABLED: 0
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
- name: Handle for Windows Build
if: ${{ matrix.goos == 'windows' }}
run: mv goyoubbs-${{ matrix.goos }}-${{ matrix.goarch }} goyoubbs-${{ matrix.goos }}-${{ matrix.goarch }}.exe
- name: Upload a Non-Windows Build Artifact
uses: actions/upload-artifact@v4
if: ${{ matrix.goos != 'windows' }}
with:
name: goyoubbs-${{ matrix.goos }}-${{ matrix.goarch }}
path: goyoubbs-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Upload a Windows Build Artifact
uses: actions/upload-artifact@v4
if: ${{ matrix.goos == 'windows' }}
with:
name: goyoubbs-${{ matrix.goos }}-${{ matrix.goarch }}.exe
path: goyoubbs-${{ matrix.goos }}-${{ matrix.goarch }}.exe