2.0.0-alpha15 #35
Workflow file for this run
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: Publish | |
on: | |
release: | |
types: [ published ] | |
permissions: | |
contents: write # important for release description edit and asset upload | |
packages: write | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
8.0.x | |
7.0.x | |
6.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Set Nadeo API secrets | |
run: | | |
dotnet user-secrets -p Tests/ManiaAPI.NadeoAPI.Tests --id d7b44d16-a183-42ef-95f5-cdcb6be7869a set "DedicatedServer:Login" "${{ secrets.NADEO_API_LOGIN }}" | |
dotnet user-secrets -p Tests/ManiaAPI.NadeoAPI.Tests --id d7b44d16-a183-42ef-95f5-cdcb6be7869a set "DedicatedServer:Password" "${{ secrets.NADEO_API_PASSWORD }}" | |
- name: Set Trackmania API secrets | |
run: | | |
dotnet user-secrets -p Tests/ManiaAPI.TrackmaniaAPI.Tests --id d864cd9f-edad-4ebf-b6e2-9c0c91bd62f8 set "ClientId" "${{ secrets.TRACKMANIA_API_CLIENTID }}" | |
dotnet user-secrets -p Tests/ManiaAPI.TrackmaniaAPI.Tests --id d864cd9f-edad-4ebf-b6e2-9c0c91bd62f8 set "ClientSecret" "${{ secrets.TRACKMANIA_API_CLIENTSECRET }}" | |
- name: Build | |
run: dotnet build -c Release --no-restore /p:ContinuousIntegrationBuild=true | |
- name: Test | |
run: dotnet test -c Release --no-build --verbosity normal | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: Src/ManiaAPI.*/bin/Release/*.nupkg | |
publish: | |
name: Publish ManiaAPI.${{ matrix.lib }} | |
needs: build | |
strategy: | |
matrix: | |
lib: [NadeoAPI, NadeoAPI.Extensions.Gbx, TMX, TMX.Extensions.Gbx, TrackmaniaAPI, TrackmaniaIO, ManiaPlanetAPI, XmlRpc] | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download a Build Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build | |
- name: Publish the ManiaAPI.${{ matrix.lib }} package to nuget.org | |
run: dotnet nuget push ManiaAPI.${{ matrix.lib }}/bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate | |
- name: Publish the ManiaAPI.${{ matrix.lib }} package to github.com | |
run: dotnet nuget push ManiaAPI.${{ matrix.lib }}/bin/Release/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bigbang1112/index.json --skip-duplicate | |
- name: Attach the ManiaAPI.${{ matrix.lib }} package to the release | |
run: gh release upload ${{ github.ref_name }} ManiaAPI.${{ matrix.lib }}/bin/Release/*.nupkg |