Add NuGet metadata to library and add two new workflows for master pull requests and releases on github

This commit is contained in:
Daniel Cronqvist 2024-08-27 22:31:48 +02:00
parent 30c0d22f93
commit 39b7625c23
5 changed files with 113 additions and 1 deletions

30
.github/workflows/release-nuget.yml vendored Normal file
View file

@ -0,0 +1,30 @@
on:
release:
types: [published]
jobs:
release-nuget:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore src/DotTiled.sln
- name: Build
run: dotnet build --no-restore src/DotTiled.sln
- name: Test
run: dotnet test --no-build --verbosity normal src/DotTiled.sln
- name: Lint style
run: dotnet format style --verify-no-changes --verbosity diagnostic src/DotTiled.sln
- name: Lint analyzers
run: dotnet format analyzers --verify-no-changes --verbosity diagnostic src/DotTiled.sln
- name: Pack
run: make pack
- name: Publish to NuGet.org
run: |
dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push ./nupkg/*.snupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate