Skip to content

Commit

Permalink
build and publish latest binary on tag to pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
kipz committed Jan 31, 2025
1 parent a5c7518 commit 487c7c9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
with:
go-version-file: go.mod
- name: Build and run tests with race detector enabled
run: just test-race
run: just test-race
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: pre-release-binaries
on:
push:
tags:
- "v*.*.*"

jobs:
build:
name: Build and Publish
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
strategy:
matrix:
goos: [linux, darwin]
goarch: [amd64, arm64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
run: |
go run gotest.tools/gotestsum@latest --format github-actions ./...
mkdir -p dist
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o dist/cofidectl-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/cofidectl/main.go
- name: Create Release
uses: softprops/action-gh-release@v2
with:
prerelease: true
files: dist/cofidectl-${{ matrix.goos }}-${{ matrix.goarch }}

0 comments on commit 487c7c9

Please sign in to comment.