Skip to content

Commit

Permalink
ci: release go binaries
Browse files Browse the repository at this point in the history
Signed-off-by: rare-magma <[email protected]>
  • Loading branch information
rare-magma committed Oct 27, 2024
1 parent afbad15 commit 43f91a2
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-push-image:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -44,4 +48,28 @@ jobs:
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
annotations: ${{ steps.meta.outputs.annotations }}

releases-matrix:
permissions:
contents: write
name: Release Go Binaries
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- name: Build
run: |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath -o pvpc_exporter main.go
- name: Compress
run: zip pvpc_exporter-${{ matrix.goos }}-${{ matrix.goarch }}.zip pvpc_exporter
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: pvpc_exporter-${{ matrix.goos }}-${{ matrix.goarch }}.zip
tag_name: latest

0 comments on commit 43f91a2

Please sign in to comment.