.github, ts_python: add GitHub workflow to publish to PyPI #101
.github, ts_python: add GitHub workflow to publish to PyPI #101dylan-tailscale merged 1 commit intomainfrom
Conversation
c429c3d to
6bc1e83
Compare
6bc1e83 to
2793d22
Compare
2793d22 to
edef959
Compare
0cc1f8b to
1ee1dc8
Compare
npry
left a comment
There was a problem hiding this comment.
looks good, nothing blocking
| # For Test PyPI, change this to "testpypi". | ||
| environment: pypi |
There was a problem hiding this comment.
Nonblocking: I think you can make this an argument in workflow_dispatch, fwiw
There was a problem hiding this comment.
Did this, but it appears workflow dispatch vars aren't provided to the workflow unless the workflow itself is on the default branch (?!?). Therefore, I've temporarily made this an env var via env, and commented-out the on.workflow_dispatch.inputs section; once this makes it to main, I'll create a follow-up PR to do this via workflow_dispatch. Wdyt?
There was a problem hiding this comment.
Nah you don't get the inputs context at all outside of workflow_dispatch and I think workflow_call? I don't believe it'll appear once this is merged, iiuc you just get the dispatch button when that happens, but the restriction about inputs still applies if it's not being triggered that way — you need to pick an alternate value if it's through a tag push or pr. I selected with case in #126
|
@npry probably worth a brief re-review; consolidated and re-arranged a lot based on your comments, added Rust caching, and am going to have to address the GitHub |
npry
left a comment
There was a problem hiding this comment.
along the lines of my reply, I think it won't fix to merge to main? but no harm in merging as is and following up also, either way
79340e8 to
7665e91
Compare
Adds GitHub workflow to build Python 3.12 wheels for Linux (x86_64/ARM64) and
macOS (ARM64), perform a publish dry run, then actually publish them to PyPI
for tagged releases. GitHub repository has Environments configured for PyPI
("pypi") and Test PyPI ("testpypi"), and both PyPI and Test PyPI projects for
`tailscale-py` have Trusted Publishers set up to allow tokenless publication
of wheels from the workflow. The GitHub environments require approval from a
team member prior to running any jobs and will only allow jobs to run on tags.
Additionally, the "publish" job in the workflow is gated on release tags or
"workflow_dispatch" only.
Signed-off-by: Dylan Bargatze <dylan@tailscale.com>
7665e91 to
a5f5d8c
Compare
Adds a GitHub workflow to build Python 3.12 wheels for Linux (x86_64/ARM64) and macOS (ARM64), then publish them to PyPI for tagged releases. The GitHub repository now has Environments configured for PyPI ("pypi") and Test PyPI ("testpypi") under
Settings -> Environmentswhich require approval to deploy to, and both the PyPI and Test PyPI projects fortailscale-pyhave Trusted Publishers set up with GitHub to allow tokenless publication of wheels from thepython.ymlworkflow.Confirmed working with Test PyPI; the
0.2.0.post2,0.2.0.post3, and0.2.0.post4releases were published from this workflow, and subsequently yanked. The latest failed publish is intentional, to test attempting to publish a different wheel for an existing release (0.2.0, which was yanked) ontestpypi.Also configures
ci.ymlto run on tag creation forv*tags.Closes #43.