Skip to content

Create matrix.yml

Create matrix.yml #1

Workflow file for this run

name: Matrix build
on: push
jobs:
example:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- { runner: macos-latest, os: darwin, arch: amd64, tags: netcgo }
- { runner: macos-latest, os: darwin, arch: arm64, tags: netcgo }
- { runner: ubuntu-latest, os: linux, arch: amd64, env: CGO_ENABLED=0 }
- { runner: ubuntu-latest, os: linux, arch: amd64, env: CGO_ENABLED=0 }
- { runner: ubuntu-latest, os: windows, arch: amd64, env: CGO_ENABLED=0 }
steps:
- uses: actions/checkout@v3
- name: Build
uses: hashicorp/actions-go-build@main
with:
product_name: example-app
product_version: 1.2.3
go_version: 1.18
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
instructions: |-
cd ./testdata/example-app && \
${{ matrix.env }} \
go build \
-o "$BIN_PATH" \
-trimpath \
-buildvcs=false \
-tags="${{ matrix.tags }}" \
-ldflags "
-X 'main.Version=$PRODUCT_VERSION'
-X 'main.Revision=$PRODUCT_REVISION'
-X 'main.RevisionTime=$PRODUCT_REVISION_TIME'
"