@@ -45,6 +45,39 @@ and attaches the built wheel and sdist. Keep `draft=true` for the first run,
4545review the generated notes and assets on GitHub, then publish the draft
4646manually.
4747
48+ For a production GitHub release plus PyPI publish, dispatch with:
49+
50+ ``` bash
51+ gh workflow run release.yml --repo bhack/mini-eq --ref main \
52+ -f dry_run=false \
53+ -f create_github_release=true \
54+ -f tag_name=vX.Y.Z \
55+ -f target=main \
56+ -f draft=true \
57+ -f prerelease=false \
58+ -f publish_testpypi=false \
59+ -f publish_pypi=true
60+ ```
61+
62+ If the ` pypi ` environment requires approval, the publish job will stay in
63+ ` waiting ` until the deployment is approved in GitHub Actions. The same approval
64+ can be done with ` gh ` when the logged-in account is allowed to approve:
65+
66+ ``` bash
67+ run_id=< workflow run id>
68+ gh api " repos/bhack/mini-eq/actions/runs/${run_id} /pending_deployments"
69+ environment_id=1234567890
70+ gh api " repos/bhack/mini-eq/actions/runs/${run_id} /pending_deployments" \
71+ -X POST \
72+ -F environment_ids[]=" $environment_id " \
73+ -f state=approved \
74+ -f comment=' Publish vX.Y.Z to PyPI'
75+ ```
76+
77+ Draft GitHub release assets use temporary ` untagged-* ` download URLs. Publish
78+ the draft before using release asset URLs in the Flathub manifest or other
79+ public metadata.
80+
4881Set ` publish_testpypi=true ` only after the ` testpypi ` GitHub environment and
4982TestPyPI trusted publisher are configured. The TestPyPI job uses
5083` pypa/gh-action-pypi-publish ` with OIDC and does not use API tokens. Keep PyPI
@@ -128,3 +161,14 @@ For production PyPI publishing, dispatch the workflow with `dry_run=false`,
128161` create_github_release=true ` , ` tag_name=vX.Y.Z ` , and ` publish_pypi=true ` .
129162Use Trusted Publishing/OIDC and the separate ` pypi ` environment rather than
130163long-lived API tokens.
164+
165+ After the workflow completes:
166+
167+ ``` bash
168+ gh release view vX.Y.Z --repo bhack/mini-eq --json tagName,isDraft,isPrerelease,assets,url
169+ curl -fsSL https://pypi.org/pypi/mini-eq/json | jq -r ' .info.version'
170+ git ls-remote --tags origin vX.Y.Z
171+ ```
172+
173+ Publish the draft GitHub release after reviewing its notes and assets. Then use
174+ the published release tarball and SHA-256 for the Flathub repository update.
0 commit comments