|
| 1 | +Release Process |
| 2 | +=============== |
| 3 | + |
| 4 | +This document describes the process for releasing a new version of Whistle. |
| 5 | + |
| 6 | +Prerequisites |
| 7 | +------------- |
| 8 | + |
| 9 | +Before releasing, ensure you have: |
| 10 | + |
| 11 | +* Push access to the GitHub repository |
| 12 | +* All changes merged to the ``main`` branch |
| 13 | +* All tests passing on CI |
| 14 | + |
| 15 | +The release process is fully automated via GitHub Actions. You only need to create and push a git tag. |
| 16 | + |
| 17 | +Release Steps |
| 18 | +------------- |
| 19 | + |
| 20 | +1. **Ensure everything is ready** |
| 21 | + |
| 22 | + Run tests locally to verify everything works: |
| 23 | + |
| 24 | + .. code-block:: bash |
| 25 | +
|
| 26 | + make test |
| 27 | + make format |
| 28 | +
|
| 29 | +2. **Create a git tag** |
| 30 | + |
| 31 | + Create a tag following semantic versioning (e.g., ``2.0.2``, ``2.1.0-rc1``): |
| 32 | + |
| 33 | + .. code-block:: bash |
| 34 | +
|
| 35 | + git tag 2.0.2 |
| 36 | + # Or for a release candidate: |
| 37 | + git tag 2.1.0-rc1 |
| 38 | +
|
| 39 | +3. **Push the tag to GitHub** |
| 40 | + |
| 41 | + .. code-block:: bash |
| 42 | +
|
| 43 | + git push origin 2.0.2 |
| 44 | +
|
| 45 | +4. **GitHub Actions takes over** |
| 46 | + |
| 47 | + Once the tag is pushed, the Release workflow automatically: |
| 48 | + |
| 49 | + * Updates the version in ``pyproject.toml`` |
| 50 | + * Builds the Python package (wheel and sdist) |
| 51 | + * Tests the package on Python 3.9-3.13 |
| 52 | + * Publishes to TestPyPI |
| 53 | + * Publishes to PyPI |
| 54 | + * Creates a GitHub Release with the built artifacts |
| 55 | + |
| 56 | +5. **Monitor the release** |
| 57 | + |
| 58 | + Watch the GitHub Actions workflow at: |
| 59 | + https://github.com/msqd/whistle/actions |
| 60 | + |
| 61 | + The workflow typically takes 5-10 minutes to complete. |
| 62 | + |
| 63 | +6. **Verify the release** |
| 64 | + |
| 65 | + Once complete, verify the release: |
| 66 | + |
| 67 | + * Check PyPI: https://pypi.org/project/whistle/ |
| 68 | + * Check GitHub Releases: https://github.com/msqd/whistle/releases |
| 69 | + * Test installation: ``pip install whistle==2.0.2`` |
| 70 | + |
| 71 | +Version Naming |
| 72 | +-------------- |
| 73 | + |
| 74 | +Follow semantic versioning: |
| 75 | + |
| 76 | +* **Stable releases**: ``X.Y.Z`` (e.g., ``2.0.2``, ``2.1.0``) |
| 77 | +* **Release candidates**: ``X.Y.Z-rcN`` (e.g., ``2.1.0-rc1``) |
| 78 | +* **Beta releases**: ``X.Y.Z-betaN`` (e.g., ``2.1.0-beta1``) |
| 79 | +* **Alpha releases**: ``X.Y.Z-alphaN`` (e.g., ``2.1.0-alpha1``) |
| 80 | + |
| 81 | +Pre-release versions (rc, beta, alpha) are automatically marked as pre-releases on GitHub. |
| 82 | + |
| 83 | +Troubleshooting |
| 84 | +--------------- |
| 85 | + |
| 86 | +**Release workflow fails** |
| 87 | + |
| 88 | +1. Check the GitHub Actions logs for errors |
| 89 | +2. Fix any issues in the code |
| 90 | +3. Delete the failed tag both locally and on GitHub: |
| 91 | + |
| 92 | + .. code-block:: bash |
| 93 | +
|
| 94 | + git tag -d 2.0.2 |
| 95 | + git push origin :refs/tags/2.0.2 |
| 96 | +
|
| 97 | +4. Create and push the tag again after fixing issues |
| 98 | + |
| 99 | +**PyPI credentials issues** |
| 100 | + |
| 101 | +The release workflow uses GitHub's trusted publishing (OIDC). No manual credentials are needed. |
| 102 | +If publishing fails, verify the PyPI trusted publisher configuration at: |
| 103 | +https://pypi.org/manage/account/publishing/ |
| 104 | + |
| 105 | +Manual Build (Testing) |
| 106 | +---------------------- |
| 107 | + |
| 108 | +To test the build process locally without publishing: |
| 109 | + |
| 110 | +.. code-block:: bash |
| 111 | +
|
| 112 | + make wheel |
| 113 | +
|
| 114 | +This creates distribution files in the ``dist/`` directory using an isolated sandbox environment. |
| 115 | + |
| 116 | +Emergency Rollback |
| 117 | +------------------ |
| 118 | + |
| 119 | +If a release has critical issues: |
| 120 | + |
| 121 | +1. **Do not delete the PyPI release** (PyPI does not allow re-uploading the same version) |
| 122 | +2. Instead, release a new patch version with the fix |
| 123 | +3. Optionally mark the problematic release as yanked on PyPI (prevents new installs but doesn't break existing ones) |
| 124 | + |
| 125 | +For yanking a release on PyPI: |
| 126 | + |
| 127 | +1. Go to https://pypi.org/project/whistle/ |
| 128 | +2. Select the problematic version |
| 129 | +3. Click "Options" → "Yank release" |
0 commit comments