Skip to content

Expand build matrix for self-contained and FD variants #1

Expand build matrix for self-contained and FD variants

Expand build matrix for self-contained and FD variants #1

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- run: dotnet test TestProject -c Release
build:
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
rid: [win-x64, linux-x64, osx-x64, osx-arm64]
selfcontained: [true, false]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Publish
run: |
if [ "${{ matrix.selfcontained }}" = "true" ]; then
dotnet publish WebGUI -c Release -r ${{ matrix.rid }} --self-contained -p:PublishSingleFile=true -p:DebugType=none -o publish/${{ matrix.rid }}
else
dotnet publish WebGUI -c Release -r ${{ matrix.rid }} --no-self-contained -p:PublishSingleFile=true -p:DebugType=none -o publish/${{ matrix.rid }}-fd
fi
- name: Set artifact name
id: names
run: |
if [ "${{ matrix.selfcontained }}" = "true" ]; then
echo "dir=publish/${{ matrix.rid }}" >> $GITHUB_OUTPUT
echo "zip=EngineBattle-${{ matrix.rid }}.zip" >> $GITHUB_OUTPUT
echo "artifact=EngineBattle-${{ matrix.rid }}" >> $GITHUB_OUTPUT
else
echo "dir=publish/${{ matrix.rid }}-fd" >> $GITHUB_OUTPUT
echo "zip=EngineBattle-${{ matrix.rid }}-framework-dependent.zip" >> $GITHUB_OUTPUT
echo "artifact=EngineBattle-${{ matrix.rid }}-framework-dependent" >> $GITHUB_OUTPUT
fi
- name: Zip
run: cd ${{ steps.names.outputs.dir }} && zip -r ../../${{ steps.names.outputs.zip }} .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.names.outputs.artifact }}
path: ${{ steps.names.outputs.zip }}
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: artifacts/EngineBattle-*.zip