-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.42 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
name: Go
on: [push]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 8 # Same as v3 and before
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: "1.23"
cache-dependency-path: go.sum
# You can test your matrix by printing the current Go version
- name: Display Go version
run: go version
- name: Install dependencies
run: go get .
- name: Build
run: |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-X 'main.Version=${{ env.GITHUB_REF_SLUG }}'" -o turbostat-exporter-${{ matrix.goos }}-${{ matrix.goarch }}
chmod +x turbostat-exporter-${{ matrix.goos }}-${{ matrix.goarch }}
# - name: Archive binaries
# uses: actions/upload-artifact@v4
# with:
# name: turbostat-exporter-${{ matrix.goos }}-${{ matrix.goarch }}
# path: turbostat-exporter-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
turbostat-exporter-*