Skip to content

ci: gate PyPI publish on full CI + approved environment - #113

Merged
Bre77 merged 1 commit into
mainfrom
fm/o10-e102-s3-python-release
Aug 6, 2026
Merged

ci: gate PyPI publish on full CI + approved environment#113
Bre77 merged 1 commit into
mainfrom
fm/o10-e102-s3-python-release

Conversation

@Bre77

@Bre77 Bre77 commented Aug 6, 2026

Copy link
Copy Markdown
Member

Intent

  • A vX.Y.Z tag push was the only trust boundary for shipping to PyPI: the publish workflow built and published straight off the tag with no re-run of lint/type/test and no human checkpoint.
    • Extracted the publish steps into a reusable workflow_call workflow (.github/workflows/release.yml) that reruns the full gate (ruff, pyright, pytest, uv build + twine check) on the exact tagged commit before touching PyPI.
    • publish-to-pypi now runs under the pypi environment and only proceeds after a manual approval - I configured the environment's required-reviewer protection via the API since there's no way to do it from Settings > Environments in the UI.
    • python-publish.yml is now a thin caller scoped to push: tags: ["v*.*.*"] (it previously ran the build job on every push to every branch) and keeps the existing PyPA OIDC trusted-publishing action unchanged.
  • release.yml takes package-dir/pypi-project-url/python-version inputs specifically so aiopowerwall and python-teslemetry-stream can call it directly (uses: Teslemetry/python-tesla-fleet-api/.github/workflows/release.yml@main) instead of each copying the job.
  • Ran ruff check, pyright, pytest, uv build, and twine check locally - all pass. The tag-triggered path itself (gate → approval → publish) is exercised by workflow structure/inputs review only; it hasn't been proven end-to-end with a real tag push, since that would actually publish a release.

Extract the publish steps into a reusable workflow_call workflow
(release.yml) so a tag push reruns the exact lint/type/test/build+twine
gate on the release SHA before publishing, and publish now waits on the
pypi environment's required-reviewer approval instead of a bare tag
push being the trust boundary. python-publish.yml becomes a thin caller
scoped to vX.Y.Z tags, and release.yml is parameterized so sibling repos
can call it directly instead of copying the job.
@Bre77 Bre77 added the fm Opened by a Firstmate crewmate label Aug 6, 2026
@Bre77
Bre77 merged commit a768396 into main Aug 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fm Opened by a Firstmate crewmate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant