Merge branch 'upcoming' into upcoming-nuget-release #76
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ] | |
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@v3 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Build the project | |
run: | | |
dotnet build OTAPI.Mods.slnf | |
(cd OTAPI.Patcher/bin/Debug/net6.0 && exec dotnet run --project ../../../OTAPI.Patcher.csproj -patchTarget=${{ matrix.profile.patch_target }} -latest=n --framework net6.0) | |
dotnet build OTAPI.Server.Launcher.slnf | |
(cd OTAPI.Server.Launcher/bin/Debug/net6.0 && exec dotnet OTAPI.Server.Launcher.dll -test-init) | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.profile.name }} NuGet Package | |
path: OTAPI.Patcher/bin/Debug/net6.0/${{ matrix.profile.package_path }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.profile.name }} Binaries | |
path: | | |
OTAPI.Patcher/bin/Debug/net6.0/artifact-*/* | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.profile.name }} Wiki MD files | |
path: OTAPI.Patcher/bin/Debug/net6.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/net6.0/${{ matrix.profile.package_path }} --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" |