- 
                Notifications
    You must be signed in to change notification settings 
- Fork 232
How to make a new release
In the following, we assume that the latest release was v0.8.1.
Furthermore, we assume the following naming conventions for remotes:
- 
origin: remote pointing toaiidateam/aiida-core
- 
fork: remote pointing to personal fork, e.g.sphuber/aiida_core
Check how your remotes are configured with git remote -v
As of v2.0, we have a very simple branching strategy.
The main branch is called main and all development happens directly on that branch through pull requests.
Creating a new release consists of the following steps:
- Deciding the type of release
- Creating the release branch
- Cherry-picking commits
- Adding the release commit
- Merging the release branch
- Creating the tag and release
- Adding post release identifier
- Communication and dependent packages
We use semantic versioning, i.e. version labels have the form v<major>.<minor>.<patch>
- Major release: v0.8.1tov1.0.0, bug fixes and new features that break backwards compatibility
- Minor release: v0.8.1tov0.9.0, bug fixes and new features that maintain backwards compatibility
- Patch release: v0.8.1tov0.8.2, only bug fixes
The exact release procedure depends on what type of release needs to be created and the current state of main.
- 
Major release: in this case, the current state of mainlikely represents the state of the code to be released. The branch can be created directly from theHEADofmain:git checkout origin/main -b release/1.0.0
- 
Minor release: if the state of maindoes not contain any breaking changes that should require a major version increase, the branch can be created directly from theHEADofmain:git checkout origin/main -b release/1.0.0If maincontains changes that should not be released, the release branch should instead be created from the latest relevant release:git checkout tags/v0.8.1 -b release/0.9.0Now the commits that should be released should be cherry-picked from mainonto the release branch.
- 
Patch release: if the state of maindoes not contain any breaking changes that should require a major version increase, or include features that would require a minor version, the branch can be created directly from theHEADofmain:git checkout origin/main -b release/1.0.0If maincontains changes that should not be released, the release branch should instead be created from the latest relevant release:git checkout tags/v0.8.1 -b release/0.8.2Now the commits that should be released should be cherry-picked from mainonto the release branch.
If the release cannot be made directly off of main because it contains commits that should not be released, the commits that are to be released should be cherry-picked onto the release branch.
This is done using the git cherry-pick command.
Find the hashes of all commits that are to be released and apply the following procedure for each of them on the release branch:
- git cherry-pick <HASH>
- 
git commit --amendand add"Cherry-pick: <HASH>"to the end of the commit message
Once done, you can check with git log that all relevant commits have now been added to the release branch.
The final commit on the release branch should be the release commit. This should contain the following changes:
- Update the __version__attribute inaiida/__init__.pyto the correct release version
- Update CHANGELOG.mdwith the changes. For small releases this can simply be a list of the added commits, divided in relevant categories. Usually using the commit title suffices, but try to add additional clarification where useful. For larger releases, an initial summary or more high-level descriptions can be useful.
- Update the AUTHORS.txtif there were new contributors.
When the changes are complete, commit the changes using the title Release v0.8.2.
Then push the release branch to the origin remote
The release branch should now be merged back into the main branch through creating a pull request of the release branch onto main.
Once the changes are approved, which should just be the changes of the release commit, the pull request should be merged with a merge commit.
It is crucial that this merge is not performed with a rebase.
In case of cherry-picked commits, there should be a merge conflict at least in aiida/__init__.py because the __version__ attribute was changed in both branches.
Make sure to keep the version number that was on main.
Prepare a new release through the Github interface.
For "Choose a tag" type the new version number (a tag should not exist yet) and as the target branch, select the release branch.
The release title should be set to AiiDA v0.8.2 and the body can be set to:
See [CHANGELOG.md](https://github.com/aiidateam/aiida-core/blob/v0.8.2/CHANGELOG.md) 
Once you save the release, a tag should be created.
The creation of the tag should automatically trigger the release.yml workflow.
This will run the tests and, if successful, will deploy the code to PyPI.
After a release has been made, the first commit that should be made to main is to add the .post0 qualifier to the version attribute in the aiida/__init__.py.
An example can be seen in this commit.
This will warn users that are (accidentally) running of the develop branch in order to prevent they perform production runs with a non-released version:
Warning: You are currently using a post release development version of AiiDA: 2.0.0.post0
Warning: Be aware that this is not recommended for production and is not officially supported.
Warning: Databases used with this version may not be compatible with future releases of AiiDA
Warning: as you might not be able to automatically migrate your data.
This works because every time Manager.load_profile is called, it calls Manager.check_version which checks the version attribute of the current installation, and if it is a post-release (i.e. the version attribute has the post release qualifier), the warning is displayed.
The choice for using the post-release identifier is a bit arbitrary, but we chose it because it is PEP440 compliant which allow us to reliably use the version parsing functionality of the packaging library.
- Announcements
- AiiDA website
- Mailing list
 
- Dependent packages
- 
aiida-core-feedstock: a PR should automatically be created.
 
-