-
Notifications
You must be signed in to change notification settings - Fork 25
52 lines (49 loc) · 1.95 KB
/
build.yml
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
43
44
45
46
47
48
49
50
51
52
name: Build USSR
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
paths-ignore:
- "**/*.md"
- "**/*.gitignore"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '6.0.x', '8.0.x' ]
dotnet-framework: [ 'net6.0', 'net8.0' ]
dotnet-runtime: [ 'win-x64', 'win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64', 'osx-arm64' ]
steps:
- uses: actions/checkout@v3
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Install dependencies
run: dotnet restore
- name: Build and Test
run: |
dotnet build -c Release --no-restore
dotnet test --logger trx --results-directory ${{ github.workspace }}/TestResults-${{ matrix.dotnet-framework }}-${{ matrix.dotnet-runtime }} --no-restore --verbosity normal
working-directory: ${{ github.workspace }}
- name: Publish
run: dotnet publish -c Release --framework ${{ matrix.dotnet-framework }} --runtime ${{ matrix.dotnet-runtime }} --no-self-contained
working-directory: ${{ github.workspace }}
- name: Copy necessary files to every runtime
run: cp classdata.tpk version.txt ${{ github.workspace }}/bin/Release/${{ matrix.dotnet-framework }}/${{ matrix.dotnet-runtime }}/publish/
working-directory: ${{ github.workspace }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: USSR-${{ matrix.dotnet-framework }}-${{ matrix.dotnet-runtime }}-latest
path: ${{ github.workspace }}/bin/Release/${{ matrix.dotnet-framework }}/${{ matrix.dotnet-runtime }}/publish/