Skip to content

chore: Change authentication to nuget.org #3

chore: Change authentication to nuget.org

chore: Change authentication to nuget.org #3

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