Skip to content

Commit 43f91a2

Browse files
committed
ci: release go binaries
Signed-off-by: rare-magma <[email protected]>
1 parent afbad15 commit 43f91a2

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/docker.yml

+29-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ env:
1010
REGISTRY: ghcr.io
1111
IMAGE_NAME: ${{ github.repository }}
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
build-and-push-image:
1519
runs-on: ubuntu-latest
@@ -44,4 +48,28 @@ jobs:
4448
push: true
4549
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
4650
labels: ${{ steps.meta.outputs.labels }}
47-
annotations: ${{ steps.meta.outputs.annotations }}
51+
annotations: ${{ steps.meta.outputs.annotations }}
52+
53+
releases-matrix:
54+
permissions:
55+
contents: write
56+
name: Release Go Binaries
57+
runs-on: ubuntu-latest
58+
strategy:
59+
matrix:
60+
goos: [linux]
61+
goarch: [amd64, arm64]
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: actions/setup-go@v5
65+
- name: Build
66+
run: |
67+
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath -o pvpc_exporter main.go
68+
- name: Compress
69+
run: zip pvpc_exporter-${{ matrix.goos }}-${{ matrix.goarch }}.zip pvpc_exporter
70+
- name: Create Release
71+
id: create_release
72+
uses: softprops/action-gh-release@v1
73+
with:
74+
files: pvpc_exporter-${{ matrix.goos }}-${{ matrix.goarch }}.zip
75+
tag_name: latest

0 commit comments

Comments
 (0)