Skip to content

Commit 81ca3a7

Browse files
committed
Expand build matrix for self-contained and FD variants
Added selfcontained to build matrix for .NET publish, enabling both self-contained and framework-dependent builds per runtime. Updated publish, artifact naming, zipping, and upload steps to handle both variants with dynamic paths and names.
1 parent c2e0074 commit 81ca3a7

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,38 @@ jobs:
2121
strategy:
2222
matrix:
2323
rid: [win-x64, linux-x64, osx-x64, osx-arm64]
24+
selfcontained: [true, false]
2425
steps:
2526
- uses: actions/checkout@v4
2627
- uses: actions/setup-dotnet@v4
2728
with:
2829
dotnet-version: '10.0.x'
2930
- name: Publish
30-
run: dotnet publish WebGUI -c Release -r ${{ matrix.rid }} --self-contained -p:PublishSingleFile=true -p:DebugType=none -o publish/${{ matrix.rid }}
31+
run: |
32+
if [ "${{ matrix.selfcontained }}" = "true" ]; then
33+
dotnet publish WebGUI -c Release -r ${{ matrix.rid }} --self-contained -p:PublishSingleFile=true -p:DebugType=none -o publish/${{ matrix.rid }}
34+
else
35+
dotnet publish WebGUI -c Release -r ${{ matrix.rid }} --no-self-contained -p:PublishSingleFile=true -p:DebugType=none -o publish/${{ matrix.rid }}-fd
36+
fi
37+
- name: Set artifact name
38+
id: names
39+
run: |
40+
if [ "${{ matrix.selfcontained }}" = "true" ]; then
41+
echo "dir=publish/${{ matrix.rid }}" >> $GITHUB_OUTPUT
42+
echo "zip=EngineBattle-${{ matrix.rid }}.zip" >> $GITHUB_OUTPUT
43+
echo "artifact=EngineBattle-${{ matrix.rid }}" >> $GITHUB_OUTPUT
44+
else
45+
echo "dir=publish/${{ matrix.rid }}-fd" >> $GITHUB_OUTPUT
46+
echo "zip=EngineBattle-${{ matrix.rid }}-framework-dependent.zip" >> $GITHUB_OUTPUT
47+
echo "artifact=EngineBattle-${{ matrix.rid }}-framework-dependent" >> $GITHUB_OUTPUT
48+
fi
3149
- name: Zip
32-
run: cd publish/${{ matrix.rid }} && zip -r ../../EngineBattle-${{ matrix.rid }}.zip .
50+
run: cd ${{ steps.names.outputs.dir }} && zip -r ../../${{ steps.names.outputs.zip }} .
3351
- name: Upload artifact
3452
uses: actions/upload-artifact@v4
3553
with:
36-
name: EngineBattle-${{ matrix.rid }}
37-
path: EngineBattle-${{ matrix.rid }}.zip
54+
name: ${{ steps.names.outputs.artifact }}
55+
path: ${{ steps.names.outputs.zip }}
3856

3957
release:
4058
needs: build

0 commit comments

Comments
 (0)