-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (50 loc) · 1.25 KB
/
ci.yml
File metadata and controls
53 lines (50 loc) · 1.25 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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: "1.24"
- run: go build ./...
- run: go test ./... -v
- run: go vet ./...
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: "1.24"
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
go build -ldflags "-s -w -X main.version=${{ github.ref_name }}" \
-o gpuaudit-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/gpuaudit
- name: Upload release asset
uses: softprops/action-gh-release@v2
with:
files: gpuaudit-${{ matrix.goos }}-${{ matrix.goarch }}