-
-
Notifications
You must be signed in to change notification settings - Fork 36
76 lines (63 loc) · 2.25 KB
/
ci-nuget.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: "CI-NuGet"
# Controls when the workflow will run
on:
# Triggers the workflow on push/pull events but only for the upcoming-nuget-release branch
push:
branches: [ upcoming-nuget-release ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
Server:
runs-on: ubuntu-latest
environment: CI
strategy:
fail-fast: false
matrix:
profile: [
{
name: PC,
patch_target: p,
package_path: OTAPI.PC.nupkg,
},
{
name: Mobile,
patch_target: m,
package_path: OTAPI.Mobile.nupkg,
},
{
name: tModLoader,
patch_target: t,
package_path: OTAPI.TML.nupkg,
},
]
name: ${{ matrix.profile.name }} Server
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Build the project
run: |
dotnet build OTAPI.Mods.slnf
(cd OTAPI.Patcher/bin/Debug/net9.0 && exec dotnet run --project ../../../OTAPI.Patcher.csproj -patchTarget=${{ matrix.profile.patch_target }} -latest=n --framework net9.0)
dotnet build OTAPI.Server.Launcher.slnf
(cd OTAPI.Server.Launcher/bin/Debug/net9.0 && exec dotnet OTAPI.Server.Launcher.dll -test-init)
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.profile.name }} NuGet Package
path: OTAPI.Patcher/bin/Debug/net9.0/${{ matrix.profile.package_path }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.profile.name }} Binaries
path: |
OTAPI.Patcher/bin/Debug/net9.0/artifact-*/*
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.profile.name }} Wiki MD files
path: OTAPI.Patcher/bin/Debug/net9.0/*.mfw.md
- name: "Releasing to NuGet: ${{ matrix.profile.name }}"
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push OTAPI.Patcher/bin/Debug/net9.0/${{ matrix.profile.package_path }} --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY"