|
| 1 | +# Release Process |
| 2 | + |
| 3 | +This document outlines the steps to release a new version of the `conductor-python` package to PyPI. Following this process ensures that releases are consistent and stable. |
| 4 | + |
| 5 | +## Summary |
| 6 | + |
| 7 | +The release process is based on the following principles: |
| 8 | +- The `main` branch is the source of truth for all releases. |
| 9 | +- Releases are triggered by creating and pushing a new git tag. |
| 10 | +- The package version is managed in `pyproject.toml`. |
| 11 | + |
| 12 | +## Step-by-Step Guide |
| 13 | + |
| 14 | +### 1. Prepare for Release |
| 15 | + |
| 16 | +Before starting the release process, ensure that: |
| 17 | +- All features, fixes, and changes for the new version have been merged into the `main` branch. |
| 18 | +- The `main` branch is stable and all automated tests are passing. |
| 19 | + |
| 20 | +### 2. Create a Release Branch |
| 21 | + |
| 22 | +Create a new branch from the `main` branch. This branch will be used to prepare the release. |
| 23 | + |
| 24 | +```bash |
| 25 | +# Ensure you are on the main branch and have the latest changes |
| 26 | +git checkout main |
| 27 | +git pull origin main |
| 28 | + |
| 29 | +# Create a release branch (e.g., release/v1.2.3) |
| 30 | +git checkout -b release/vX.Y.Z |
| 31 | +``` |
| 32 | +Replace `X.Y.Z` with the new version number. |
| 33 | + |
| 34 | +### 3. Bump the Package Version |
| 35 | + |
| 36 | +In the release branch, you must update the package version in the `pyproject.toml` file. |
| 37 | + |
| 38 | +1. Open `pyproject.toml`. |
| 39 | +2. Locate the `version` field under the `[tool.poetry]` section. |
| 40 | +3. Update the version to the new version number (e.g., `version = "1.2.3"`). |
| 41 | + |
| 42 | +Commit the version change. If `poetry.lock` was modified, add it to the commit as well. |
| 43 | +```bash |
| 44 | +git add pyproject.toml poetry.lock |
| 45 | +git commit -m "Bump version to vX.Y.Z" |
| 46 | +``` |
| 47 | + |
| 48 | +**Important:** This is a critical step. The version in `pyproject.toml` is used by the GitHub Actions pipeline to publish the package. |
| 49 | + |
| 50 | +### 4. Final Testing |
| 51 | + |
| 52 | +Although the `main` branch should be stable, it is good practice to run the full test suite one more time within the release branch to catch any issues related to the version bump. |
| 53 | + |
| 54 | +### 5. Merge the Release Branch into Main |
| 55 | + |
| 56 | +Create a Pull Request (PR) to merge your `release/vX.Y.Z` branch back into `main`. |
| 57 | + |
| 58 | +- Clearly state in the PR title that it's for a release (e.g., "Release vX.Y.Z"). |
| 59 | +- After the PR is reviewed and approved, merge it. |
| 60 | +- Delete the release branch after the merge. |
| 61 | + |
| 62 | +### 6. Create and Push the Git Tag |
| 63 | + |
| 64 | +This is the final step that triggers the deployment pipeline. |
| 65 | + |
| 66 | +1. First, make sure your local `main` branch is up-to-date with the merge commit from the previous step. |
| 67 | + ```bash |
| 68 | + git checkout main |
| 69 | + git pull origin main |
| 70 | + ``` |
| 71 | + |
| 72 | +2. Create an annotated git tag. The tag name **must** match the version number in `pyproject.toml` and should be prefixed with `v`. |
| 73 | + ```bash |
| 74 | + # Example for version 1.2.3 |
| 75 | + git tag -a v1.2.3 -m "Release version 1.2.3" |
| 76 | + ``` |
| 77 | + |
| 78 | +3. Push the tag to the remote repository. |
| 79 | + ```bash |
| 80 | + # Example for version 1.2.3 |
| 81 | + git push origin v1.2.3 |
| 82 | + ``` |
| 83 | + |
| 84 | +### 7. Verify the Release |
| 85 | + |
| 86 | +- Pushing the tag will trigger the "Release" workflow in GitHub Actions. |
| 87 | +- Monitor the workflow to ensure it completes successfully. |
| 88 | +- Once the workflow is finished, navigate to the project's page on [PyPI](https://pypi.org/project/conductor-python/) to verify that the new version has been published. |
0 commit comments