Skip to content

Build Binaries

Build Binaries #4

Workflow file for this run

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:

Check failure on line 51 in .github/workflows/go.yml

View workflow run for this annotation

GitHub Actions / Build Binaries

Invalid workflow file

The workflow is not valid. .github/workflows/go.yml (Line: 51, Col: 9): 'with' is already defined
files: |
varunastra_linux_amd64.zip
varunastra_linux_arm64.zip
varunastra_darwin_amd64.zip
varunastra_darwin_arm64.zip