diff --git a/.github/workflows/publish-Oauth2-package.yml b/.github/workflows/publish-Oauth2-package.yml index 0c648431..555b0e2d 100644 --- a/.github/workflows/publish-Oauth2-package.yml +++ b/.github/workflows/publish-Oauth2-package.yml @@ -18,6 +18,7 @@ jobs: permissions: contents: write pull-requests: write + id-token: write steps: @@ -53,8 +54,14 @@ jobs: run: dotnet pack working-directory: Xero-NetStandard + - name: NuGet login (OIDC -> temp API key) + uses: NuGet/login@v1 + id: nuget_login + with: + user: ${{ vars.NUGET_USER }} + - name: Publish OAuth2 Package to Nuget.org - run: dotnet nuget push ./Xero.NetStandard.OAuth2/bin/Release/Xero.NetStandard.OAuth2.${{steps.get_latest_release_number.outputs.release_tag}}.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json + run: dotnet nuget push ./Xero.NetStandard.OAuth2/bin/Release/Xero.NetStandard.OAuth2.${{steps.get_latest_release_number.outputs.release_tag}}.nupkg --api-key ${{ steps.nuget_login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json working-directory: Xero-NetStandard notify-codegen-repo: diff --git a/.github/workflows/publish-Oauth2Client-package.yml b/.github/workflows/publish-Oauth2Client-package.yml index b46c7b22..39697d7b 100644 --- a/.github/workflows/publish-Oauth2Client-package.yml +++ b/.github/workflows/publish-Oauth2Client-package.yml @@ -21,6 +21,7 @@ jobs: permissions: contents: write pull-requests: write + id-token: write steps: @@ -141,9 +142,16 @@ jobs: run: dotnet pack ./Xero.NetStandard.OAuth2Client/Xero.NetStandard.OAuth2Client.csproj working-directory: Xero-NetStandard + - name: NuGet login (OIDC -> temp API key) + if: steps.check_changes.outputs.has_changes == 'true' + uses: NuGet/login@v1 + id: nuget_login + with: + user: ${{ vars.NUGET_USER }} + - name: Publish OAuth2Client Package to Nuget.org if: steps.check_changes.outputs.has_changes == 'true' - run: dotnet nuget push ./Xero.NetStandard.OAuth2Client/bin/Release/Xero.NetStandard.OAuth2Client.${{steps.calc_version.outputs.version}}.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json + run: dotnet nuget push ./Xero.NetStandard.OAuth2Client/bin/Release/Xero.NetStandard.OAuth2Client.${{steps.calc_version.outputs.version}}.nupkg --api-key ${{ steps.nuget_login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json working-directory: Xero-NetStandard - name: Commit, Push and Tag