Skip to content

1.0.0

1.0.0 #1

name: Release Binaries
on:
# Run when we create a new GitHub release
release:
types: [created]
jobs:
release-linux:
runs-on: ubuntu-latest
env:
artifact: adder-${{ github.event.release.tag_name }}.tar.gz
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ vars.GO_VERSION }}
- name: Build binary
run: env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o adder cmd/main.go
- name: Create tar file
run: tar -czvf ${{ env.artifact }} adder
- name: Upload artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} ${{ env.artifact }}
release-windows:
runs-on: windows-latest
env:
artifact: adder-${{ github.event.release.tag_name }}.zip
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ vars.GO_VERSION }}
- name: Build executable
run: env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o adder.exe cmd/mjssetup/main.go
- name: Create zip file
run: Compress-Archive -Path adder.exe -Destination ${{ env.artifact }}
- name: Upload artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} ${{ env.artifact }}