Skip to content

Commit 75da94d

Browse files
Update dotnet-build.yml
1 parent 0db952c commit 75da94d

File tree

1 file changed

+41
-18
lines changed

1 file changed

+41
-18
lines changed

.github/workflows/dotnet-build.yml

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,57 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
DOTNET_VERSION: 8.0.x
8+
49
jobs:
5-
build:
10+
11+
build-and-publish:
612
runs-on: ${{ matrix.os }}
13+
714
strategy:
815
matrix:
9-
os: [ubuntu-latest, windows-latest]
16+
os: [ubuntu-latest, windows-latest, macOS-latest, macos-14]
1017
include:
11-
- os: ubuntu-latest
12-
target: linux-x64
13-
- os: windows-latest
14-
target: win-x64
15-
env:
16-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
18+
- os: ubuntu-latest
19+
runtime-identifier: linux-x64
20+
- os: windows-latest
21+
runtime-identifier: win-x64
22+
- os: macOS-latest
23+
runtime-identifier: osx-x64
24+
- os: macos-14
25+
runtime-identifier: osx-arm64
26+
fail-fast: false
1727

1828
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v4
29+
- uses: actions/checkout@v4
2130

22-
- name: Install .NET Core
31+
- name: Setup .NET
2332
uses: actions/setup-dotnet@v4
2433
with:
25-
dotnet-version: 8.0
34+
dotnet-version: ${{ env.DOTNET_VERSION }}
35+
36+
- name: Nuget cache
37+
uses: actions/cache@v4
38+
with:
39+
path:
40+
~/.nuget/packages
41+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
42+
restore-keys: |
43+
${{ runner.os }}-nuget-
44+
- name: Build
45+
run: dotnet build -c Release
2646

27-
- name: Build ${{ matrix.target }}
28-
run: dotnet publish Interface/Interface.csproj -r ${{ matrix.target }} -c release -o "${{ github.workspace }}/builds/${{ matrix.target }}"
47+
- name: Publish Engine
48+
run: dotnet publish Interface/Interface.csproj -c Release --runtime ${{ matrix.runtime-identifier }} --self-contained /p:PublishSingleFile=true /p:PublishTrimmed=true -o artifacts/${{ matrix.runtime-identifier }}
2949

30-
- name: Upload ${{ matrix.target }} Build
50+
- name: Upload Izumi-chan-${{ github.run_number }}-${{ matrix.runtime-identifier }} artifact
3151
uses: actions/upload-artifact@v4
3252
with:
33-
name: Interface-${{ matrix.target }}
34-
path: ${{ github.workspace }}/builds/${{ matrix.target }}
53+
name: Izumi-chan-${{ github.run_number }}-${{ matrix.runtime-identifier }}
54+
path: |
55+
artifacts/${{ matrix.runtime-identifier }}/
56+
!artifacts/**/*.pdb
57+
if-no-files-found: error

0 commit comments

Comments
 (0)