Skip to content

Build and Release Go Binaries #5

Build and Release Go Binaries

Build and Release Go Binaries #5

Workflow file for this run

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 }}