Conversation
Publishes to TestPyPI on manual trigger and to PyPI on GitHub Release. Maintainer setup is tracked in danieldeer#228. Refs danieldeer#229
|
@fe-neu |
|
In additional the question: I just know it from azure from the last company i worked for. They had the policy the build pipelines only run on manuel trigger. |
|
@AnnoDomine Sorry, I could have explained better what #228 and #229 are trying to do. The goalThe goal is to make releasing a new version to PyPI simple and repeatable. Once everything is set up, a release works like this:
This is a fairly standard setup for Python packages. Your questionsDo we need to create a tag manually? Do we need to trigger the action?
Recommended: set up the
The run waits with "Waiting for review" until one of the reviewers approves it in the Actions tab. This is set under Settings → Environments → What the workflow does
Why are build and publish separate jobs? What's still needed#228 lists the remaining steps, which need owner/admin access: the GitHub environments (including the approval rules above), the Trusted Publisher registration on PyPI/TestPyPI, and so on. The exact values to enter are in this PR's description. If anything is still unclear, I'm happy to explain more or jump on a call. |
Thanks a lot for the detailed overview. |
MarkVDD
left a comment
There was a problem hiding this comment.
Looks good to me. Please target main, since chore/contributor-workflow-and-docs has been merged already ;)
Done |
|
Does this work without me setting up anything on pypi @fe-neu ? |
No this will not work just like this. See Issue #228 In short you have to setup this on pypi:
In here : https://pypi.org/manage/account/publishing/ I know you have more Experience with GitLab, so If you would like any help with this let me know! |

Description
Adds a GitHub Actions workflow that publishes seriousdb to PyPI and TestPyPI using Trusted Publishing (OIDC), so no API tokens are needed.
workflow_dispatch) as a dry run before a real release.v*is published. Tag pushes alone don't start it, and releases without a version tag are skipped.The workflow won't work until the maintainer setup in #228 is done. The values needed for that are listed below.
Closes #229
Type of Change
Key Changes
.github/workflows/publish.yml:build: only runs for manual runs or releases taggedv*; other releases are skipped, not failed. Runsuv build(sdist + wheel), thentwine check --strict, and saves the files for the publish jobs. On a release, it fails if the tag isn't exactlyv<version>frompyproject.toml.publish-testpypi/publish-pypi: download the files and publish them withpypa/gh-action-pypi-publish.id-token: write, which Trusted Publishing needs.id-token: write.attestations: writeis not needed.uv buildinstead ofpython -m buildto match the other workflows. The output is the same.Setup needed for #228
Trusted Publisher settings (PyPI and TestPyPI):
seriousdbseriousdbdanieldeerdanieldeerseriousdbseriousdbpublish.ymlpublish.ymlpypitestpypiNotes:
mainbefore it works:publish.ymlis on the default branch.publish.yml.pypiandtestpypiin repo settings. The names must match exactly.pypito tags matchingv*. Release runs deploy from the tag, not a branch, and GitHub enforces this rule even if the workflow is changed later.testpypineeds to allow whichever branch the manual run is started from (e.g.main).v<version>matchingpyproject.toml(e.g.v0.1.0), or the build job fails. Releases without av*tag are skipped.Validation
uv build: sdist and wheel built successfully.uvx twine check --strict dist/*: both passed.v0.1.0passes;v0.2.0and0.1.0fail against version0.1.0.main. The first real test would be a manual TestPyPI run once both are in place.Checklist
uv run ruff check .anduv run ruff format --check ., or this PR does not change Python.