Commit 817d467
Add GitHub workflow to publish to PyPI
Summary:
Adds `.github/workflows/release.yml` so tintype can be published to PyPI from
GitHub Actions. The workflow builds platform-specific wheels via cibuildwheel
(needed because tintype has a pybind11 C++ extension), plus an sdist, and
publishes via OIDC Trusted Publishing (no API tokens stored as secrets).
- Triggers:
- Push tag `v*` → publish to TestPyPI (validation channel)
- GitHub Release published → publish to PyPI (production)
- `workflow_dispatch` → manual TestPyPI publish
- Matrix: `ubuntu-latest` + `macos-latest`. Windows is intentionally omitted
because the C++ code in `snapshot_lib/` doesn't currently compile on MSVC.
- `CIBW_BUILD`: cp312 + cp313. `CIBW_SKIP` drops manylinux_i686 and musllinux.
- `CIBW_ARCHS_MACOS: "x86_64 arm64"` so Intel Mac users get a wheel too
(macos-latest runners are now Apple Silicon).
- Least-privilege `permissions: contents: read` at workflow level;
`id-token: write` only on the publish jobs.
- Concurrency cancels in-flight tag/manual runs on the same ref but NEVER
cancels a `release: published` run mid-publish.
- `skip-existing: true` on TestPyPI publish (manual re-runs are idempotent),
not on PyPI publish (duplicates must fail loudly).
Follow-ups for the maintainer (out of scope for this commit):
- Configure Trusted Publisher on pypi.org + test.pypi.org (see comment in
file).
- Create GitHub `pypi` + `testpypi` environments in repo settings.
- Bump hard-coded version in pyproject.toml (or migrate to setuptools-scm)
before tagging.
Reviewed By: youngd007
Differential Revision: D103339939
fbshipit-source-id: c3a39e343cb659f665a6b5fe1b55a07667dd6cf71 parent 7e0bb0d commit 817d467
1 file changed
Lines changed: 131 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
0 commit comments