Skip to content

Commit

Permalink
Added release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Devang-Solanki authored Oct 20, 2024
1 parent 247d71e commit 8f28826
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Binaries

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
os: [ubuntu-latest, macos-latest] # OS for building
arch: [amd64, arm64] # Architectures for building

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.20' # Specify your Go version here

- name: Build binaries
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
if [[ "${{ matrix.arch }}" == "amd64" ]]; then
GOOS=linux GOARCH=amd64 go build .
zip varunastra_linux_amd64.zip myapp
elif [[ "${{ matrix.arch }}" == "arm64" ]]; then
GOOS=linux GOARCH=arm64 go build .
zip varunastra_linux_arm64.zip myapp
fi
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
if [[ "${{ matrix.arch }}" == "amd64" ]]; then
GOOS=darwin GOARCH=amd64 go build .
zip varunastra_darwin_amd64.zip myapp
elif [[ "${{ matrix.arch }}" == "arm64" ]]; then
GOOS=darwin GOARCH=arm64 go build .
zip varunastra_darwin_arm64.zip myapp
fi
fi
- name: Upload binaries to release
uses: softprops/action-gh-release@v1
with:
tag: ${{ github.event.release.tag_name }} # Use the release tag for the upload
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub Actions
with:
files: |
varunastra_linux_amd64.zip
varunastra_linux_arm64.zip
varunastra_darwin_amd64.zip
varunastra_darwin_arm64.zip

0 comments on commit 8f28826

Please sign in to comment.