Manual NuGet Publish #5
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: Manual NuGet Publish | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Building, Packaging and Publishing | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET 9 SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build Api | |
| run: dotnet build "Api/.NET API.csproj" --no-restore --configuration Release | |
| - name: Pack NuGet package | |
| run: dotnet pack "Api/.NET API.csproj" --no-build --configuration Release --output ./nupkg | |
| - name: Push NuGet package to nuget.org | |
| run: dotnet nuget push ./nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} | |
| env: | |
| NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |