diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3197b0cb..ff22954b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,18 +18,13 @@ jobs: permissions: actions: read contents: write - id-token: write # Required for Azure CLI Login + id-token: write # Required for Azure / NuGet CLI Login steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: ⚙️ Initialization shell: pwsh run: | - if ('${{ secrets.NUGET_API_KEY }}') { - Write-Host "NUGET_API_KEY secret detected. NuGet packages will be pushed." - echo "NUGET_API_KEY_DEFINED=true" >> $env:GITHUB_ENV - } - if ('${{ secrets.NPM_API_KEY }}') { Write-Host "NPM_API_KEY secret detected. NPM packages will be pushed." echo "NPM_API_KEY_DEFINED=true" >> $env:GITHUB_ENV @@ -115,9 +110,14 @@ jobs: gh release -R ${{ github.repository }} upload "${{ github.ref_name }}" $_.FullName } + - name: 🪪 Authorize NuGet package push + uses: NuGet/login@v1 + id: nuget-login + with: + user: ${{ secrets.NUGET_USER }} + - name: 🚀 Push NuGet packages - run: dotnet nuget push ${{ runner.temp }}\deployables\*.nupkg --source https://api.nuget.org/v3/index.json -k '${{ secrets.NUGET_API_KEY }}' - if: ${{ env.NUGET_API_KEY_DEFINED == 'true' }} + run: dotnet nuget push ${{ runner.temp }}\deployables\*.nupkg --source https://api.nuget.org/v3/index.json -k '${{ steps.nuget-login.outputs.NUGET_API_KEY }}' - name: 🚀 Push NPM packages shell: pwsh