How to release a new version
----------------------------
To follow these steps, you need to be one of the maintainers for imod on both
`PyPI `_ and `conda-forge
`_, as well as access to the
`Deltares Teamcity build environment `_.
1. Update the :doc:`../api/changelog` and the ``__version__`` in ``imod/__init__.py``,
and the version entry in the ``pixi.toml`` for complenetess.
2. Create a tag on your local machine and push it GitHub. `Old tags are here
`_. `Old releases are
here `_. The tag name should be ``vx.y.z``,
where x, y and z are version numbers according to `Semantic Versioning
`_.
3. On Teamcity go to the `Deploy All
`_
build step in the `Deploy` project.
4. Press the `Run` button and select the `Changes` Tab.
5. Select the branch/tag you want to release and press `Run Build`
The TeamCity pipeline will:
1. Create a release on GitHub
2. Create the imod-python package and upload it to PyPi
3. Build the documentation and deploy it
The release is now available on PyPi but not yet on conda-forge. The conda-forge
bot will automatically open a PR to update `the imod feedstock.
`_ It usually takes a few hours
before the bot opens a PR. This PR will be reviewed by the imod-feedstock
maintainers and merged if everything is in order.
Release a pre-release
^^^^^^^^^^^^^^^^^^^^^
To release a pre-release, follow the same steps as above, but add a ``rc`` to the
version + a build number. For example: ``1.0.0rc0`` for the first release candidate.
PyPI will automatically recognize this as a pre-release, thus will not show it
as a stable build. To get the pre-release on conda-forge, you need to:
1. Fork `the imod-feedstock `_
2. Checkout the ``rc`` branch of the imod-feedstock
3. Update the version in the ``recipe/meta.yaml`` file to the pre-release version, e.g. ``1.0.0rc0``
4. Update the sha256 checksum in the ``recipe/meta.yaml`` file, you can generate one by running:
``curl -sL https://pypi.io/packages/source/i/imod/imod-{{version}}.tar.gz | openssl sha256``
(TIP: On Windows, you can install curl and openssl via pixi)
5. Commit and push the changes to your fork
6. Open a PR to the imod-feedstock and make sure it merges to the ``rc`` branch.
7. This will trigger a few CI jobs. When these succeed, the branch can be merged.