Does anyone have experience with automatic publishing via the Github workflow for collective packages? Does that make sense?
Yes, works fine.
Example Github Actions workflow here:
You need to configure in Github under settings an "Environment", here namend release-pypi
with whatever protection you like. I added 3 trusted reviewers and limited it to "v*" tags.
I configured on PyPI for the project
Owner: edutap-eu
Repository-name: edutap.wallet_google
Workflow: release.yaml
Environment name: release-pypi
Thats basically it. Prepare your repository (like edit the version in pyproject.toml, ...) - do not tag!Then use the release feature of Github, right columns "Releases" and draft a new release. Give it a new tag name starting with v, like "v2.4.1".
Then - if all is double checked - use the button "publish release".
You (and/or the trusted reviewers) receive a notification to review the release. Once reviewed the release flow runs and everything is after some minutes on PyPI.
The example GHA workflow above also runs tests before and does a release on test-pypi, but you can skip it.
[Edit] Another, simpler version here
And another more complex example is mxmake
last GHA flow here
workflows