|
1 | 1 | name: Build |
2 | 2 |
|
3 | | -on: [push, pull_request] |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +env: |
| 7 | + DOTNET_VERSION: 8.0.x |
| 8 | + |
4 | 9 | jobs: |
5 | | - build: |
| 10 | + |
| 11 | + build-and-publish: |
6 | 12 | runs-on: ${{ matrix.os }} |
| 13 | + |
7 | 14 | strategy: |
8 | 15 | matrix: |
9 | | - os: [ubuntu-latest, windows-latest] |
| 16 | + os: [ubuntu-latest, windows-latest, macOS-latest, macos-14] |
10 | 17 | 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 |
17 | 27 |
|
18 | 28 | steps: |
19 | | - - name: Checkout |
20 | | - uses: actions/checkout@v4 |
| 29 | + - uses: actions/checkout@v4 |
21 | 30 |
|
22 | | - - name: Install .NET Core |
| 31 | + - name: Setup .NET |
23 | 32 | uses: actions/setup-dotnet@v4 |
24 | 33 | 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 |
26 | 46 |
|
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 }} |
29 | 49 |
|
30 | | - - name: Upload ${{ matrix.target }} Build |
| 50 | + - name: Upload Izumi-chan-${{ github.run_number }}-${{ matrix.runtime-identifier }} artifact |
31 | 51 | uses: actions/upload-artifact@v4 |
32 | 52 | 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