Skip to content

Automatically update Dotnet SDK #78

Automatically update Dotnet SDK

Automatically update Dotnet SDK #78

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}}