Automatically update Dotnet SDK #78
This file contains hidden or 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 Package to NuGet | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup NuGet | |
| uses: NuGet/setup-nuget@v2 | |
| - name: Restore dependencies | |
| run: dotnet restore src/TrophyApi.sln | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 8.x | |
| - name: Install tools | |
| run: | | |
| dotnet tool restore | |
| - name: Build Release | |
| run: | | |
| export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true | |
| dotnet build src/TrophyApi.sln --configuration Release --no-restore | |
| - name: Run tests | |
| run: dotnet test src | |
| - name: Publish | |
| run: | | |
| dotnet pack src/TrophyApi/TrophyApi.csproj -c Release -o out | |
| dotnet nuget push **/*.nupkg -s 'https://api.nuget.org/v3/index.json' -k ${{secrets.NUGET_API_KEY}} |