Skip to content

Commit

Permalink
chore: add binaries to releases
Browse files Browse the repository at this point in the history
Signed-off-by: Bengt Wegner <[email protected]>
  • Loading branch information
Petzys committed Sep 19, 2024
1 parent bf6b518 commit 1fa6c00
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/release_binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build Release Binaries

on:
release:
types:
- created

jobs:
build:
name: Build Release Assets
runs-on: ubuntu-latest

strategy:
matrix:
# Add more platforms as needed
goos: [linux, darwin, windows]
goarch: [amd64, arm64]

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'

- name: Install dependencies
run: go get .

- name: Display the release tag
run: echo ${{ github.event.release.tag_name }}

- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/go/bin
key: ${{ runner.os }}-go-${{ matrix.goos }}-${{ matrix.goarch }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Build binary
run: |
mkdir -p dist
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o dist/app-${{ matrix.goos }}-${{ matrix.goarch }} .
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: binaries
path: dist/

- name: Upload the binaries
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: dist/*
file_glob: true

0 comments on commit 1fa6c00

Please sign in to comment.