Skip to content

Commit 303f59f

Browse files
jaimergpmgorny
andauthored
How to: Maintain several versions (#2661)
Co-authored-by: Michał Górny <[email protected]>
1 parent ea392f8 commit 303f59f

File tree

3 files changed

+61
-7
lines changed

3 files changed

+61
-7
lines changed

docs/_sidebar_diataxis.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@
115115
"href": "/docs/maintainer/knowledge_base/#multi-output-recipes"
116116
},
117117
{
118-
"type": "link",
118+
"type": "doc",
119119
"label": "Maintain several versions",
120-
"href": "/docs/maintainer/updating_pkgs/#maintaining-several-versions"
120+
"id": "how-to/advanced/several-versions"
121121
},
122122
{
123123
"type": "link",
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
:::

docs/maintainer/updating_pkgs.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,7 @@ For an example see [this](https://github.com/conda-forge/cudnn-feedstock/issues/
304304

305305
## Maintaining several versions
306306

307-
If you'd like to maintain more than one version of your package, you can use branches on the feedstock. To do this:
308-
309-
- Fork your feedstock and make a meaningful branch name (e.g., v1.X or v1.0).
310-
- Make the required changes to the recipe and rerender the feedstock.
311-
- Then push this branch from your fork to the upstream feedstock. Our CI services will automatically build any branches in addition to the default branch.
307+
See [How to maintain several versions](/docs/how-to/advanced/several-versions.md).
312308

313309
## Troubleshooting
314310

0 commit comments

Comments
 (0)