release_process.rst 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. Release Process
  2. ~~~~~~~~~~~~~~~~~
  3. CloudBridge is published to PyPI automatically by the `deploy workflow
  4. <https://github.com/CloudVE/cloudbridge/blob/main/.github/workflows/deploy.yaml>`_
  5. using PyPI `trusted publishing <https://docs.pypi.org/trusted-publishers/>`_
  6. (OIDC). There is no stored API token and no manual ``twine upload`` step. Two
  7. events drive the workflow:
  8. * **Pushing a tag** (e.g. ``v4.1.0``) builds the distributions and publishes
  9. them to **TestPyPI** (already-uploaded files are skipped).
  10. * **Publishing a GitHub Release** for that tag publishes the distributions to
  11. **production PyPI**.
  12. Because the ``release`` event reads the workflow definition from the commit the
  13. tag points to, always create the tag on a commit that already contains the
  14. current ``deploy.yaml``.
  15. 1. Make sure all tests pass on the `GitHub Actions workflows
  16. <https://github.com/CloudVE/cloudbridge/actions>`_.
  17. 2. Increment the version number in ``cloudbridge/__init__.py`` as per
  18. `semver rules <https://semver.org/>`_.
  19. 3. Freeze all library dependencies in ``pyproject.toml`` and commit.
  20. The version numbers can be a range with the upper limit being the latest
  21. known working version, and the lowest being the last known working version.
  22. In general, our strategy is to make provider sdk libraries fixed within
  23. relatively known compatibility ranges, so that we reduce the chances of
  24. breakage. If someone uses CloudBridge, presumably, they do not use the SDKs
  25. directly. For all other general purpose libraries, our strategy is to make
  26. compatibility as broad and unrestricted as possible.
  27. 4. Add release notes to ``CHANGELOG.rst``. Also add the last commit hash to the
  28. changelog. The list of commits can be obtained using
  29. ``git shortlog <last release hash>..HEAD``.
  30. 5. Commit the version bump and changelog, and push to ``main``.
  31. .. code-block:: bash
  32. git commit -am "Release 4.1.0"
  33. git push origin main
  34. 6. Tag the release commit and push the tag. This triggers the deploy workflow,
  35. which publishes to TestPyPI. Optionally verify the staged release at
  36. https://test.pypi.org/project/cloudbridge/ before continuing.
  37. .. code-block:: bash
  38. git tag -a v4.1.0 -m "Release 4.1.0"
  39. git push origin v4.1.0
  40. 7. Create a GitHub Release for the tag. Publishing the release triggers the
  41. deploy workflow, which publishes to production PyPI. Confirm the upload at
  42. https://pypi.org/project/cloudbridge/.
  43. .. code-block:: bash
  44. gh release create v4.1.0 --title "4.1.0" --notes-file <release-notes>