This file contains the workflow required to make a PyBaMM
release on GitHub, PyPI, and conda-forge by the maintainers.
-
The
update_version.yml
workflow will run on every 1st of January, May and September, updating incrementing the version tovYY.MMrc0
by runningscripts/update_version.py
in the following files --
pybamm/version.py
-
docs/conf.py
-
CITATION.cff
-
pyproject.toml
-
vcpkg.json
-
CHANGELOG.md
These changes will be automatically pushed to a new branch
vYY.MM
and a PR fromvvYY.MM
todevelop
will be created (to sync the branches).
-
-
Create a new GitHub pre-release with the tag
vYY.MMrc0
from thevYY.MM
branch and a description copied fromCHANGELOG.md
. -
This release will automatically trigger
publish_pypi.yml
and create a pre-release on PyPI.
If a new release candidate is required after the release of rc{X-1}
-
-
Cherry-pick the bug fix (no new features should be added to
vYY.MM
oncerc{X-1}
is released) commit tovYY.MM
branch once the fix is merged intodevelop
. The CHANGELOG entry for such fixes should go under therc{X-1}
heading inCHANGELOG.md
-
Run
update_version.yml
manually while usingappend_to_tag
to specify the release candidate version number (rc1
,rc2
, ...). -
This will increment the version to
vYY.MMrcX
by runningscripts/update_version.py
in the following files --
pybamm/version.py
-
docs/conf.py
-
CITATION.cff
-
pyproject.toml
-
vcpkg.json
-
CHANGELOG.md
These changes will be automatically pushed to the existing
vYY.MM
branch and a PR will be created to update version strings indevelop
.
-
-
Create a new GitHub pre-release with the same tag (
vYY.MMrcX
) from thevYY.MM
branch and a description copied fromCHANGELOG.md
. -
This release will automatically trigger
publish_pypi.yml
and create a pre-release on PyPI.
Once satisfied with the release candidates -
-
Run
update_version.yml
manually, leaving theappend_to_tag
field blank ("") for an actual release. -
This will increment the version to
vYY.MMrcX
by runningscripts/update_version.py
in the following files --
pybamm/version.py
-
docs/conf.py
-
CITATION.cff
-
pyproject.toml
-
vcpkg.json
-
CHANGELOG.md
These changes will be automatically pushed to the existing
vYY.MM
branch and a PR will be created to update version strings indevelop
.
-
-
Next, a PR from
vYY.MM
tomain
will be generated that should be merged once all the tests pass. -
Create a new GitHub release with the same tag from the
main
branch and a description copied fromCHANGELOG.md
. -
This release will automatically trigger
publish_pypi.yml
and create a release on PyPI.
Some other essential things to check throughout the release process -
- If updating our custom vcpkg registory entries pybamm-team/sundials-vcpkg-registry or pybamm-team/casadi-vcpkg-registry (used to build Windows wheels), make sure to update the baseline of the registories in vcpkg-configuration.json to the latest commit id.
- Update jax and jaxlib to the latest version in
pybamm.util
andpyproject.toml
, fixing any bugs that arise - As the release workflow is initiated by the
release
event, it's important to note that the defaultGITHUB_REF
used byactions/checkout
during the checkout process will correspond to the tag created during the release process. Consequently, the workflows will consistently build PyBaMM based on the commit associated with this tag. Should new commits be introduced to thevYY.MM
branch, such as those addressing build issues, it becomes necessary to manually update this tag to point to the most recent commit -git tag -f <tag_name> <commit_hash> git push -f <pybamm-team/PyBaMM_remote_name> <tag_name> # can only be carried out by the maintainers
- If changes are made to the API, console scripts, entry points, new optional dependencies are added, support for major Python versions is dropped or added, or core project information and metadata are modified at the time of the release, make sure to update the
meta.yaml
file in therecipe/
folder of the conda-forge/pybamm-feedstock repository accordingly by following the instructions in the conda-forge documentation and re-rendering the recipe - The conda-forge release workflow will automatically be triggered following a stable PyPI release, and the aforementioned updates should be carried out directly in the main repository by pushing changes to the automated PR created by the conda-forge-bot. A manual PR can also be created if the updates are not included in the automated PR for some reason. This manual PR must bump the build number in
meta.yaml
and must be from a personal fork of the repository.