Build and Release Go Binaries #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Release Go Binaries | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.21' | |
| - name: Build binaries for all platforms | |
| run: | | |
| GOOS=linux GOARCH=amd64 go build -o commit-msg-go-linux-amd64 commit-msg.go | |
| GOOS=linux GOARCH=arm64 go build -o commit-msg-go-linux-arm64 commit-msg.go | |
| GOOS=darwin GOARCH=amd64 go build -o commit-msg-go-darwin-amd64 commit-msg.go | |
| GOOS=darwin GOARCH=arm64 go build -o commit-msg-go-darwin-arm64 commit-msg.go | |
| GOOS=windows GOARCH=amd64 go build -o commit-msg-go-windows-amd64.exe commit-msg.go | |
| GOOS=windows GOARCH=arm64 go build -o commit-msg-go-windows-arm64.exe commit-msg.go | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| commit-msg-go-linux-amd64 | |
| commit-msg-go-linux-arm64 | |
| commit-msg-go-darwin-amd64 | |
| commit-msg-go-darwin-arm64 | |
| commit-msg-go-windows-amd64.exe | |
| commit-msg-go-windows-arm64.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_PAT }} |