diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1aba57d..9420106 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 @@ -44,4 +48,28 @@ jobs: push: true tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest labels: ${{ steps.meta.outputs.labels }} - annotations: ${{ steps.meta.outputs.annotations }} \ No newline at end of file + 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 \ No newline at end of file