Skip to content

Build Go binaries and upload release #6

Build Go binaries and upload release

Build Go binaries and upload release #6

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: List files in build directory
run: ls -l build/
- name: Upload binaries to GitHub release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/${{ matrix.goos }}-${{ matrix.goarch }}/weave
asset_name: weave-${{ matrix.goos }}-${{ matrix.goarch }}
asset_content_type: application/octet-stream