π Publish NuGet Package #3
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 NuGet Package | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: π§Ύ Checkout code | |
| uses: actions/checkout@v4 | |
| - name: π Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.x' | |
| - name: π Restore dependencies | |
| run: dotnet restore | |
| - name: π Build solution | |
| run: dotnet build --configuration Release | |
| - name: π¦ Pack NuGet package for ${{ github.event.repository.name }} | |
| run: dotnet pack ./src/**/*.csproj --configuration Release --output ./nupkg | |
| - name: π Publish to NuGet.org | |
| run: dotnet nuget push ./nupkg/*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NuGet_API_Key }} # | |