Skip to content

Add PyPI publish CD (release-labelled PR -> build & upload)#11

Open
poissoncorp wants to merge 1 commit into
ravendb:v7.2from
poissoncorp:add-pypi-cd
Open

Add PyPI publish CD (release-labelled PR -> build & upload)#11
poissoncorp wants to merge 1 commit into
ravendb:v7.2from
poissoncorp:add-pypi-cd

Conversation

@poissoncorp

Copy link
Copy Markdown
Contributor

What

Adds a two-stage, PR-gated CD pipeline that publishes ravendb-test-driver to PyPI via GitHub Actions.

  • prepare-release.yml (manual): run from the Actions tab with a version input. Bumps the version across setup.py (version=, the ravendb-embedded== and ravendb~= pins) and requirements.txt, then opens a PR labelled release.
  • publish.yml: when a PR carrying the release label is merged, builds sdist+bdist_wheel, uploads to PyPI via twine using __token__, then creates the <version> git tag + GitHub release. Also runnable manually as a fallback.

How to release

  1. Actions → "Prepare release PR" → Run workflow → enter e.g. 7.2.2.
  2. Review the generated PR.
  3. Merge it (keep the release label) → the package publishes automatically.

Important

This package pins ravendb-embedded==<version>. Publish ravendb-embedded first (its own release PR), then merge this one — otherwise consumers can't resolve the dependency.

Remove the release label before merging to merge without publishing.

Required setup (one-time)

  • Add repo secret PYPI_API_TOKEN — a project-scoped PyPI API token.
  • Settings → Actions → General → Workflow permissions → enable "Allow GitHub Actions to create and approve pull requests".

Notes

  • A human merge of the labelled PR triggers publish (the bot opening the PR with GITHUB_TOKEN does not auto-trigger).
  • twine --skip-existing keeps re-runs idempotent.

Adds two GitHub Actions workflows:
- prepare-release.yml: manual dispatch; bumps version in setup.py
  (version=, ravendb-embedded==, ravendb~=) and requirements.txt, then opens a
  PR labelled "release".
- publish.yml: on merge of the labelled PR, builds sdist+wheel, uploads to PyPI
  via twine, then creates the version git tag + GitHub release.

Requires repo secret PYPI_API_TOKEN and the "Allow GitHub Actions to create and
approve pull requests" setting enabled. Note: ravendb-test-driver pins
ravendb-embedded==<version>, so publish ravendb-embedded first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant