1.0.0 #1
Workflow file for this run
This file contains 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: 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 }} |