Skip to content

feat: build matrix

feat: build matrix #27

Workflow file for this run

name: release
on:
push:
branches:
- "**"
tags:
- "**"
jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: darwin
goarch: amd64
artifact_name: paddler-bin-darwin-amd64
- goos: darwin
goarch: arm64
artifact_name: paddler-bin-darwin-arm64
- goos: linux
goarch: amd64
artifact_name: paddler-bin-linux-amd64
- goos: windows
goarch: amd64
artifact_name: paddler-bin-windows-amd64.exe
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set up go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build
run: |
make -C management build
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ${{ matrix.artifact_name }}
- name: determine tag type
id: tag_type
run: |
if [[ ${{ github.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+$ ]]; then
echo "tag_type=PRE_RELEASE_TAG" >> $GITHUB_OUTPUT
elif [[ ${{ github.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "tag_type=RELEASE_TAG" >> $GITHUB_OUTPUT
else
echo "tag_type=INVALID_TAG" >> $GITHUB_OUTPUT
fi
- name: upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
file: ${{ matrix.artifact_name }}
asset_name: ${{ matrix.artifact_name }}
overwrite: true
prerelease: steps.tag_type.outputs.tag_type == 'PRE_RELEASE_TAG'
tag: ${{ github.ref }}