Skip to content

Update release workflow for matrix builds #10

Update release workflow for matrix builds

Update release workflow for matrix builds #10

Workflow file for this run

name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
build-and-release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
rid: win-x64
- os: windows-latest
rid: win-arm64
- os: ubuntu-latest
rid: linux-x64
- os: ubuntu-latest
rid: linux-arm64
- os: macos-latest
rid: osx-x64
- os: macos-latest
rid: osx-arm64
env:
PROJECT_PATH: Tusk/Tusk.csproj
CONFIGURATION: Release
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Restore
run: dotnet restore $PROJECT_PATH
- name: Publish AOT single file (${{ matrix.rid }})
shell: bash
run: |
dotnet publish $PROJECT_PATH \
-c $CONFIGURATION \
-r ${{ matrix.rid }} \
-p:PublishSingleFile=true \
-p:SelfContained=true \
-p:PublishAot=true \
-p:StripSymbols=true \
-p:DebugType=none
- name: Archive binary
shell: bash
run: |
OUT_DIR="Tusk/bin/$CONFIGURATION/net10.0/${{ matrix.rid }}/publish"
BINARY_NAME="tusk-${{ matrix.rid }}"
mv "$OUT_DIR/Tusk" "$OUT_DIR/$BINARY_NAME" 2>/dev/null || mv "$OUT_DIR/Tusk.exe" "$OUT_DIR/$BINARY_NAME.exe"
tar -C "$OUT_DIR" -czf "${BINARY_NAME}.tar.gz" .
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
files: |
tusk-${{ matrix.rid }}*.tar.gz files: |
tusk-*.tar.gz