-
Notifications
You must be signed in to change notification settings - Fork 25
63 lines (52 loc) · 2.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
57
58
59
60
61
62
63
name: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test building with vendoring (#35)
run: go mod vendor && go build -mod=vendor ./cli/main.go
- name: Build
run: |
CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -ldflags="-s -w" -o auth-thu.macos.x86_64 ./cli/main.go
CGO_ENABLED=0 GOARCH=arm64 GOOS=darwin go build -ldflags="-s -w" -o auth-thu.macos.arm64 ./cli/main.go
CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -ldflags="-s -w" -o auth-thu.win64.exe ./cli/main.go
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags="-s -w" -o auth-thu.linux.x86_64 ./cli/main.go
CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -ldflags="-s -w" -o auth-thu.linux.arm64 ./cli/main.go
CGO_ENABLED=0 GOARCH=arm GOOS=linux go build -ldflags="-s -w" -o auth-thu.linux.arm ./cli/main.go
CGO_ENABLED=0 GOARCH=arm GOARM=5 GOOS=linux go build -ldflags="-s -w" -o auth-thu.linux.armv5 ./cli/main.go
CGO_ENABLED=0 GOARCH=arm GOARM=6 GOOS=linux go build -ldflags="-s -w" -o auth-thu.linux.armv6 ./cli/main.go
CGO_ENABLED=0 GOARCH=mipsle GOOS=linux GOMIPS=softfloat go build -ldflags="-s -w" -o auth-thu.linux.mipsle ./cli/main.go
CGO_ENABLED=0 GOARCH=mips GOOS=linux GOMIPS=softfloat go build -ldflags="-s -w" -o auth-thu.linux.mipsbe ./cli/main.go
CGO_ENABLED=0 GOARCH=ppc64le GOOS=linux go build -ldflags="-s -w" -o auth-thu.linux.ppc64le ./cli/main.go
CGO_ENABLED=0 GOARCH=riscv64 GOOS=linux go build -ldflags="-s -w" -o auth-thu.linux.riscv64 ./cli/main.go
CGO_ENABLED=0 GOARCH=loong64 GOOS=linux go build -ldflags="-s -w" -o auth-thu.linux.loong64 ./cli/main.go
build-image:
name: Build Docker Image
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build the Docker image
uses: docker/build-push-action@v5
with:
push: false
context: .