Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
needs: [create_nuget, build_and_test]
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
Expand All @@ -115,6 +115,16 @@ jobs:
uses: actions/setup-dotnet@v6
with:
dotnet-version: "10.0.x"
# If this is a tag build, log in to NuGet using OIDC. For this to work,
# - One of the ubisoft-square organization (https://www.nuget.org/profiles/ubisoft-square) admin user accounts
# was used to set up a Trusted Publishing (https://www.nuget.org/account/trustedpublishing)
# - NUGET_USER was set as an Actions repository secret (https://github.com/ubisoft/NGitLab/settings/secrets/actions) to that admin's username
- name: NuGet login (OIDC)
id: nuget-login
if: startsWith(github.ref, 'refs/tags/')
uses: NuGet/login@v1
with:
user: ${{secrets.NUGET_USER}}
- name: Publish NuGet packages
run: |
Write-Host "Current ref: $env:GITHUB_REF"
Expand All @@ -124,7 +134,7 @@ jobs:
if ($env:GITHUB_REF -clike 'refs/tags/*')
{
Write-Host "Pushing NuGet package: $($file.FullName)"
& dotnet nuget push "$($file.FullName)" --api-key "${{secrets.NUGET_APIKEY}}" --source https://api.nuget.org/v3/index.json --force-english-output --skip-duplicate
& dotnet nuget push "$($file.FullName)" --api-key "${{steps.nuget-login.outputs.NUGET_API_KEY}}" --source https://api.nuget.org/v3/index.json --force-english-output --skip-duplicate
}
else
{
Expand Down
Loading