-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
247d71e
commit 8f28826
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
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 |