Build Plugin #150
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
name: Build Plugin | |
on: | |
workflow_call: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
release-golang-plugin: | |
name: Release binary | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [ "linux", "darwin", "windows" ] | |
goarch: [ ["amd64", "x64"] ] # TODO - ARM64 runner, ["aarch64", "arm64"] ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.18 | |
cache: true | |
cache-dependency-path: go.sum | |
- name: Build Golang | |
run: | | |
go version | |
go mod vendor | |
go build -o "protoc-gen-sdk-${{ matrix.goos }}-${{ matrix.goarch[1] }}$( If ($IsWindows) {'.exe'} Else {''})" | |
working-directory: ./ | |
shell: pwsh | |
env: | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch[0] }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: "go-plugin" | |
path: ./protoc-gen-sdk-* |