Repository navigation
Add GitHub workflow to build and publish the NuGet package - #155
Merged
Martin-Molinero merged 2 commits intoOct 29, 2026
Merged
Martin-Molinero merged 2 commits into
Martin-Molinero merged 2 commits into
Conversation
- Add build_push_nuget.sh, which packs the QuantConnect.pythonnet NuGet and symbol packages and pushes them when NUGET_API_KEY is set - Add a workflow that runs it on published releases, using the release tag as the version and nuget.org Trusted Publishing (OIDC) instead of a long-lived API key. Manual runs only build the package - Remove the upstream monthly preview workflow, which has been failing on every scheduled run and never published a package - Exclude dot-files from the packed pythonnet/ content so the nuspec does not list the .gitignore and .gitkeep files NuGet leaves out - Keep *.sh files with LF line endings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the version in the csproj instead of a release tag, so publishing is a single manual run of the workflow from master. nuget.org rejects versions that already exist, so a run without a version bump fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publishes
QuantConnect.pythonnetto nuget.org from a manual GitHub Actions run, instead of packing and pushing it by hand.To release: bump
<Version>insrc/runtime/Python.Runtime.csproj, merge, then run Publish NuGet from the Actions tab. nuget.org rejects versions that already exist, so a run without a version bump fails. The job only runs onmaster.Changes
build_push_nuget.sh: packs the NuGet and symbol packages intoartifacts/with the csproj version and pushes them whenNUGET_API_KEYis set. It first removes ignored files underpythonnet/(build outputs,__pycache__), since everything in that folder is packed as content..github/workflows/publish.yml: manual workflow that gets a short-lived API key through nuget.org Trusted Publishing (NuGet/login) and runs the script.nuget-preview.yml: the upstream monthly preview job. It failed on every scheduled run (Aug, Sep and Oct 2026), never published a preview, and relied on a long-livedNUGET_MONTHLYkey.Python.Runtime.csproj: excludes dot-files from the packedpythonnet/**content. NuGet already leaves.gitignoreand.gitkeepout of the package, but the nuspec still listed them; this also removes the two NU5119 warnings..gitattributes:*.shis always checked out with LF so the script runs from Git Bash on Windows.Why now
nuget.org API keys created before August 17, 2026 expire on November 1, 2026 and new keys only last 30 days (announcement).
Verification
Ran the script on a clean checkout of
ba1b2ea(the commit 2.0.67 was built from) and compared it with the 2.0.67 package on nuget.org:clr.py, thepythonnetPython files,deps.json, README, LICENSE and icon are byte-identicalbranchattribute, which comes from the locally checked-out branch name (my test checkout was detached).actions/checkoutcreates a localmasterbranch, so runs from master write the samerefs/heads/masterPython.Runtime.dllhas the same size; the 420 differing bytes are the build path, MVID, PE timestamp and strong-name signature (2.0.67 was built inC:\Users\jhona\...)The workflow itself has not run yet.
Required setup before the first run
QuantConnect, repositorypythonnet, workflow filepublish.ymlNUGET_USERrepository secret with the owner's nuget.org profile name🤖 Generated with Claude Code