Skip to content

Build Go binaries and upload release #10

Build Go binaries and upload release

Build Go binaries and upload release #10

Workflow file for this run

name: Build Go binaries and upload to release
on:
release:
types:
- published
jobs:
build:
name: Build Go binaries
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin]
goarch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.6'
- name: Build binary
run: |
mkdir -p build
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/weave-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.goos }}-${{ matrix.goarch }}-binary
path: build/${{ matrix.goos }}-${{ matrix.goarch }}/weave
# - name: Upload binaries to GitHub release
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: build/weave-${{ matrix.goos }}-${{ matrix.goarch }}
# asset_name: weave-${{ matrix.goos }}-${{ matrix.goarch }}
# asset_content_type: application/octet-stream