Skip to content

Set up NuGet trusted publishing.#584

Merged
teo-tsirpanis merged 2 commits into
TileDB-Inc:mainfrom
teo-tsirpanis:nuget-trusted-publishing
Oct 13, 2025
Merged

Set up NuGet trusted publishing.#584
teo-tsirpanis merged 2 commits into
TileDB-Inc:mainfrom
teo-tsirpanis:nuget-trusted-publishing

Conversation

@teo-tsirpanis

Copy link
Copy Markdown
Member

Fixes CORE-372.

@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

uses: nuget/login@v1
id: nuget-login
with:
user: ${{ vars.NUGET_USER }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious where NUGET_USER would be set?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only see actions secrets in the settings panel so probably I am lacking permissions for environments settings, but SGTM 👍

Comment thread .github/workflows/release.yml Outdated
run: |
cd pack
dotnet nuget push "*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.TILEDB_CSHARP_NUGET_KEY }}
dotnet nuget push "*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ steps.nuget-login.outputs.NUGET_API_KEY || secrets.NUGET_KEY }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to update the secret variable name when you are ready to use this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this PR gets merged, I will delete the TILEDB_CSHARP_NUGET_KEY secret. I used the NUGET_KEY secret (and the just-added NUGET_FEED variable) to easily support publishing nightly packages to an alternative feed that does not support trusted publishing.

The whole arrangement follows what I've been doing in some personal projects (example).

release environment

Image

nightly environment

Image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks for sharing!

@teo-tsirpanis
teo-tsirpanis merged commit 734a855 into TileDB-Inc:main Oct 13, 2025
4 checks passed
@teo-tsirpanis
teo-tsirpanis deleted the nuget-trusted-publishing branch October 13, 2025 18:01
@teo-tsirpanis

Copy link
Copy Markdown
Member Author

For the record, trusted publishing failed because as it turns out, it is not yet available for organizations (NuGet/NuGetGallery#10581). Thankfully, the updated workflowallows switching between API key-based publishing without changes to source code. I pushed the package manually, and updated the release environment to use API keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants