Publish miles-rl wheel to PyPI via Trusted Publishing (Phase 7) - #1231
Closed
Shi-Dong wants to merge 1 commit into
Closed
Publish miles-rl wheel to PyPI via Trusted Publishing (Phase 7)#1231Shi-Dong wants to merge 1 commit into
Shi-Dong wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the version of the miles-rl package in setup.py from '0.2.1' to '0.0.1' for its first public PyPI release, adding a comment explaining the versioning strategy. There are no review comments, and I have no feedback to provide.
Shi-Dong
marked this pull request as ready for review
May 28, 2026 06:50
3 tasks
Shi-Dong
force-pushed
the
shi/phase6-bundle-third-party-into-miles
branch
from
May 30, 2026 08:17
45f2041 to
5d64d45
Compare
Shi-Dong
force-pushed
the
shi/phase7-publish-pypi
branch
2 times, most recently
from
June 1, 2026 16:12
9a66871 to
9ef42e9
Compare
Shi-Dong
force-pushed
the
shi/phase6-bundle-third-party-into-miles
branch
2 times, most recently
from
June 2, 2026 04:40
484d7cd to
60ff36a
Compare
Shi-Dong
force-pushed
the
shi/phase7-publish-pypi
branch
from
June 2, 2026 04:40
9ef42e9 to
1e4511e
Compare
Shi-Dong
force-pushed
the
shi/phase6-bundle-third-party-into-miles
branch
from
June 2, 2026 09:07
60ff36a to
c08360a
Compare
Shi-Dong
force-pushed
the
shi/phase7-publish-pypi
branch
from
June 2, 2026 09:07
1e4511e to
335b60f
Compare
Shi-Dong
force-pushed
the
shi/phase6-bundle-third-party-into-miles
branch
from
June 3, 2026 15:02
c08360a to
ccdd862
Compare
Shi-Dong
force-pushed
the
shi/phase7-publish-pypi
branch
from
June 3, 2026 15:02
335b60f to
a0afd1f
Compare
Adds .github/workflows/publish-pypi.yml that uses pypa/gh-action-pypi-publish with OIDC. PyPI has been pre-registered to trust this exact workflow + repo, so no PYPI_API_TOKEN secret is needed. Bumps setup.py version from 0.2.1 to 0.0.1: the first public miles-rl release. This is what the workflow will upload on the first non-dry-run invocation; PyPI version-immutability means this number will claim the public miles-rl namespace forever. Safety nets in the workflow: (1) dry_run defaults to true on workflow_dispatch so an accidental fire just builds the wheel; (2) pre-upload check curls PyPI for the version to fail fast if its already published; (3) post-upload smoke install validates pip install miles-rl from real PyPI works and the bundled sglang/megatron/miles packages all land at the expected site-packages paths.
Shi-Dong
force-pushed
the
shi/phase6-bundle-third-party-into-miles
branch
from
June 4, 2026 13:10
ccdd862 to
9f5cdd3
Compare
Shi-Dong
force-pushed
the
shi/phase7-publish-pypi
branch
from
June 4, 2026 13:10
a0afd1f to
371783b
Compare
Contributor
Author
|
Superseded. Replaced by a thin packaging slice cut fresh off current `main`:
This branch was 457 commits behind `main` and its submodule pin for sglang was 2831 commits stale and no longer an ancestor of `sglang-miles`. Rebasing it would also have resurrected the `examples/experimental/swe-agent` submodules that #1918 deliberately deleted. The branch is left in place; nothing is lost. |
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.
Summary
.github/workflows/publish-pypi.yml: publishes the bundledmiles-rlwheel to https://pypi.org/ via PyPI Trusted Publishing (OIDC). No long-lived API token in the repo's secrets.setup.pyversionfrom0.2.1to0.0.1— the first publicmiles-rlrelease.Why
Phase 7 of the
pip install miles-rlroadmap, completing the journey:miles_megatron_plugins, broaden Megatron-LM packaging, pin Megatron-Bridge (Move miles_megatron_plugins into the miles repo as a top-level package #1177, Broaden megatron-core packaging and drop CPU PYTHONPATH override #1188, Pin Megatron-Bridge to an exact commit instead of branch=bridge #1194)extras_requireslots (Add empty cpu/gpu/training extras_require slots (Phase 4) #1196)miles-rlname on PyPI and upload the first release.Why OIDC / Trusted Publishing
PYPI_API_TOKENsecret in the repo. Tokens stored in CI are a known leak surface.owner=radixark,repo=miles,workflow=publish-pypi.yml. An attacker who somehow got code into a different workflow couldn't upload asmiles-rl.miles-rl,publish-pypi.yml, no environment) — confirmed by the project owner.Safety nets in the workflow
dry_rundefaults totrueonworkflow_dispatch. Accidentally firing the workflow just builds the wheel; uploading requires explicitdry_run=false.pypa/gh-action-pypi-publish, the workflow curlshttps://pypi.org/pypi/miles-rl/<version>/json. If PyPI already has that version (PyPI versions are immutable), the workflow hard-fails with a clear error instead of letting twine return a confusing 400.python:3.11venv runspip install miles-rl==<version>from real PyPI and verifies (viaimportlib.util.find_spec, no init execution) that the bundledmiles,miles_plugins,miles_megatron_plugins,sglang,megatron,megatron.core,megatron.trainingall land at the expected site-packages paths.Test plan
gh workflow run publish-pypi.yml --ref shi/phase7-publish-pypi -f dry_run=false. This is the first upload that claimsmiles-rlon PyPI permanently.pip install miles-rl==0.0.1on a fresh production-equivalent devbox (image:radixark/miles:dev), thenpython -c "import miles; import sglang; import megatron.core; import megatron.training; import miles_megatron_plugins.true_on_policy.contracts"withPYTHONPATHunset (this is the real end-to-end test, matching the one we ran on TestPyPI for Phase 6).Stacked on
radixark/miles PR #1226 (Phase 6 bundling).
Pre-merge cleanup
push:trigger frompublish-pypi.ymlonce it has landed on the default branch (onlyworkflow_dispatchshould remain for subsequent releases).After this PR merges
For each subsequent miles-rl release:
version=insetup.pyto a new PEP 440-compliant string.gh workflow run publish-pypi.yml --ref main -f dry_run=false. The wheel is built frommainand uploaded.