chore: Change authentication to nuget.org #3
Workflow file for this run
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: .NET Linux Publish Release | |
| permissions: | |
| id-token: write | |
| on: | |
| release: | |
| types: [ "published" ] | |
| pull_request: | |
| branches: [ "**" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Restore dependencies | |
| run: dotnet restore Pmad.Cartography.sln | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release Pmad.Cartography.sln -p:PublicRelease=true | |
| - name: Test | |
| run: dotnet test --no-build --verbosity normal --configuration Release Pmad.Cartography.sln | |
| - name: NuGet login (OIDC → temp API key) | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Publish Nuget to nuget.org | |
| run: dotnet nuget push **/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate | |
| - name: Publish NuGet package to GitHub | |
| run: | | |
| dotnet nuget add source --username jetelain --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/jetelain/index.json" | |
| dotnet nuget push **/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s github --skip-duplicate | |