-
Notifications
You must be signed in to change notification settings - Fork 34
43 lines (38 loc) · 1.34 KB
/
release-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Project Release
on:
release:
types:
- published
jobs:
build-server:
strategy:
matrix:
version:
- 8.0.x
target:
- linux-arm
- linux-arm64
- linux-x64
- win-x64
- win-x86
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet ${{ matrix.version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.version}}
- name: Compile target
run: dotnet publish Source/Server/GameServer.csproj -c Release -r ${{ matrix.target }} --self-contained true -p:PublishSingleFile=true -p:PublishReadyToRun=true
- name: Find release
run: ls Source/Server/bin/Release/net8.0/${{ matrix.target }}/publish
- name: Rename and Zip Linux release
run: zip -j ${{ matrix.target }}.zip Source/Server/bin/Release/net8.0/${{ matrix.target }}/publish/GameServer
if: startsWith( matrix.target, 'linux')
- name: Rename and Zip Windows release
run: zip -j ${{ matrix.target }}.zip Source/Server/bin/Release/net8.0/${{ matrix.target }}/publish/GameServer.exe
if: startsWith( matrix.target, 'win')
- name: Upload compressed release
uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.target }}.zip