Skip to content

Commit

Permalink
feat: build matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
mcharytoniuk committed Jul 15, 2024
1 parent 2d8da82 commit 30a7bce
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,25 @@ on:
- "**"

jobs:
release:
name: create release
build:
name: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

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
Expand All @@ -22,9 +37,10 @@ jobs:
with:
go-version: '1.21'

- name: build
- name: Build
run: |
make paddler-bin-linux-x64
make -C management build
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ${{ matrix.artifact_name }}
- name: determine tag type
id: tag_type
Expand All @@ -37,22 +53,11 @@ jobs:
echo "tag_type=INVALID_TAG" >> $GITHUB_OUTPUT
fi
- name: create pre-release
id: create_prerelease
if: steps.tag_type.outputs.tag_type == 'PRE_RELEASE_TAG'
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
files: paddler-bin-linux-x64
generate_release_notes: true
prerelease: true

- name: create release
id: create_release
if: steps.tag_type.outputs.tag_type == 'RELEASE_TAG'
uses: softprops/action-gh-release@v2
- name: upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
fail_on_unmatched_files: true
files: paddler-bin-linux-x64
generate_release_notes: true
prerelease: false
file: ${{ matrix.artifact_name }}
asset_name: ${{ matrix.artifact_name }}
overwrite: true
prerelease: steps.tag_type.outputs.tag_type == 'PRE_RELEASE_TAG'
tag: ${{ github.ref }}

0 comments on commit 30a7bce

Please sign in to comment.