Skip to content

Publishing

github-actions[bot] edited this page Nov 23, 2026 · 10 revisions

Publishing setup

Publishing is manual. The Publish package workflow has no push, tag or release-event trigger. It runs only after a maintainer starts it on master with an existing release tag and the confirmation publish.

Development branches and manual package publishing workflow

One-time account configuration

Create an account on PyPI and a separate account on TestPyPI. Enable the account's required two-factor authentication. For a new project, add a pending publisher on each service using its account publishing settings. For an existing project, use its project publishing settings.

Enter these exact values for the GitHub Trusted Publisher:

Setting Value
Project name smd-reports
Repository owner SMD-Bioinformatics-Lund
Repository smd-reports
Workflow filename release.yml
Environment on PyPI pypi
Environment on TestPyPI testpypi

The repository uses matching GitHub environments restricted to the master branch. The workflow obtains short-lived publishing credentials through OIDC; no PyPI token needs to be committed or stored in repository secrets. Account-side registration must be completed by the account holder in PyPI and TestPyPI.

See the official Trusted Publishing guide for account-side registration. If the GitHub repository is private, its documentation and example links will remain private too; publishing a package does not change repository visibility.

Publish a release

After the development PR is merged into dev and the release PR is merged into master:

  1. Confirm the version in src/smd_reports/__init__.py and the changelog.
  2. Create the matching tag, for example v0.1.1, on the release commit in master.
  3. Open GitHub Actions → Publish package → Run workflow.
  4. Select branch master, enter the tag, choose testpypi and type publish.
  5. Review the completed checks and TestPyPI installation verification.
  6. Start the workflow separately with the same tag and index pypi when ready.

The workflow requires a matching nonempty changelog entry and a version newer than previous release tags on master. It also checks tag/version agreement, tag existence and ancestry, then runs a successful merged release PR with exactly the same Git tree. Its Quality run must have passed lint, documentation, every supported Python version and PDF tests, and its branch-flow checks must have passed. Fork runs, skipped checks and changed release contents do not satisfy this requirement.

Publication then builds and checks distributions and verifies isolated wheel/source installation. It reuses the completed PR validation instead of repeating the full test suite for TestPyPI and PyPI. Each index still requires its own explicit dispatch. Only the checked artifacts are passed to the publishing job. Package versions cannot be overwritten; an existing version requires a new release rather than replacement files.

Clone this wiki locally