|
| 1 | +--- |
| 2 | +tags: [how-to, advanced] |
| 3 | +--- |
| 4 | + |
| 5 | +# How to maintain several versions |
| 6 | + |
| 7 | +The conda-forge workflow assumes that a push to any branch in the feedstock repository will result in a build being uploaded to the conda-forge channel (and that's why PRs must always be opened from a fork!). |
| 8 | + |
| 9 | +Most feedstocks only need `main` for their builds, since the package has a single release line, and new releases always imply a later version. However, some packages may maintain a few release lines in parallel. If you wish to maintain those in your feedstock, you will need to create a branch for each. |
| 10 | + |
| 11 | +## Create the new branch |
| 12 | + |
| 13 | +:::note |
| 14 | +This operation can only be performed by users with write acccess to the feedstock. |
| 15 | +::: |
| 16 | + |
| 17 | +In the local copy of your [forked repository](../basics/fork-sync.md), create a branch named after the release line you want to maintain. For example, for `3.10`, it could be: |
| 18 | + |
| 19 | +```bash |
| 20 | +git checkout main |
| 21 | +git pull upstream main |
| 22 | +git checkout -b v3.10.x |
| 23 | +``` |
| 24 | + |
| 25 | +Add an empty commit with the `[ci skip]` message so the new branch does not result in a new build process, and push it to `upstream`. This is one of the rare ocassions where you must push directly to the feedstock, not your fork! |
| 26 | + |
| 27 | +```bash |
| 28 | +git commit --allow-empty -m "[ci skip] Create new branch for v3.10.x release series" |
| 29 | +git push -u upstream v3.10.x |
| 30 | +``` |
| 31 | + |
| 32 | +Now, this branch can be selected as a target branch in the following steps. |
| 33 | + |
| 34 | +## Open a PR with the necessary changes |
| 35 | + |
| 36 | +From the same branch, create another one to add some extra changes that will need to be reviewed in a PR: |
| 37 | + |
| 38 | +```bash |
| 39 | +git checkout -b setup-3.10.x |
| 40 | +``` |
| 41 | + |
| 42 | +Open your `conda-forge.yml` file and add these lines: |
| 43 | + |
| 44 | +```yaml |
| 45 | +bot: |
| 46 | + abi_migration_branches: |
| 47 | + - "v3.10.x" # or the branch name you picked |
| 48 | +``` |
| 49 | +
|
| 50 | +And [rerender](../basics/rerender.md). Now, make sure to adjust the recipe file so the correct version is being built. |
| 51 | +
|
| 52 | +Once ready, push the branch to your fork (`origin`) and open the corresponding pull request. Don't forget to pick `v3.10.x` as the target branch! |
| 53 | + |
| 54 | +:::note |
| 55 | + |
| 56 | +In some cases, the `abi_migration_branches` may receive migration PRs that have already been processed. This is being looked into at [regro/cf-scripts#2500](https://github.com/regro/cf-scripts/issues/2500). In the meantime, you can ignore these redundant PRs by closing them. |
| 57 | + |
| 58 | +::: |
0 commit comments