Skip to content

Commit 4cb370f

Browse files
committed
πŸ“š Add developer release instructions
1 parent 251895b commit 4cb370f

File tree

4 files changed

+81
-2
lines changed

4 files changed

+81
-2
lines changed

β€Ždocs/source/conf.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Add any Sphinx extension module names here, as strings. They can be
2020
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2121
# ones.
22-
extensions = ['sphinx_copybutton', 'autoapi.extension', 'sphinx_click', 'sphinx.ext.intersphinx']
22+
extensions = ['sphinx_copybutton', 'autoapi.extension', 'sphinx_click', 'sphinx.ext.intersphinx', 'myst_parser']
2323

2424
# Settings for the `sphinx_copybutton` extension
2525
copybutton_selector = 'div:not(.no-copy)>div.highlight pre'

β€Ždocs/source/dev.mdβ€Ž

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Development
2+
3+
## Release
4+
5+
### Version
6+
7+
We use [semantic versioning](https://semver.org/), i.e. version labels have the form `v<major>.<minor>.<patch>`
8+
9+
* Patch release: `v1.7.1` to `v1.7.2`, only bug fixes
10+
* Minor release: `v1.7.1` to `v1.8.0`, bug fixes and new features that **maintain** backwards compatibility.
11+
* Major release: `v1.7.1` to `v2.0.0`, bug fixes and new features that **break** backwards compatibility.
12+
13+
In the steps below, we'll assume the version to be released is `v1.7.2`.
14+
15+
### Steps
16+
17+
To make a new release of the `aiida-pseudo` plugin package, first create a release branch based on the latest `main` branch:
18+
19+
```console
20+
git fetch --all --prune
21+
git checkout origin/main -b release/1.7.2
22+
```
23+
24+
Next, update the source code `__version__` in the `src/aiida_pseudo/__init__.py` file by hand.
25+
It should look something like this:
26+
27+
```
28+
"""AiiDA plugin that simplifies working with pseudo potentials."""
29+
__version__ = '1.7.2'
30+
```
31+
32+
Then, run the `update_changelog.py` script to update the `CHANGELOG.md` with all the changes made since the last release:
33+
34+
```console
35+
python .github/workflows/update_changelog.py
36+
```
37+
38+
This will automatically add:
39+
40+
1. The header for the new release and the sub-headers in which the commits should be sorted.
41+
2. The list of commits since the previous release, with links to them.
42+
43+
Sort the commit items into the correct subsection of the change log.
44+
Ideally, the main changes or new features are also described at the top of the change log message, providing code snippets where it's useful.
45+
46+
Once you've prepared the release branch locally, commit and push it to Github:
47+
48+
git commit -am 'πŸš€ Release `v1.7.2`'
49+
git push -u origin release/1.7.2
50+
51+
Now that the release branch is ready, merge it into `main` via a pull request.
52+
Make sure the remote `release/1.7.2` branch is up to date by pushing the local changes, then go to Github and create a pull request to the `main` branch of the official repository.
53+
54+
After the pull request has been approved, merge the PR using the "Squash and Merge", and make sure the commit is simply named e.g. "πŸš€ Release `v1.7.2`".
55+
56+
Once this is complete, fetch all the changes locally, checkout the `main` branch and make sure it's up to date with the remote:
57+
58+
git fetch --all
59+
git checkout main
60+
git pull origin
61+
62+
Next, tag the final release commit:
63+
64+
git tag -a v1.7.2 -m 'Release `v1.7.2`'
65+
66+
**IMPORTANT**: once you push the tag to GitHub, a workflow will start that automatically publishes a release on PyPI.
67+
Double check that the tag is correct, and that the `main` branch looks in good shape.
68+
69+
If you accidentally tagged the wrong commit, you can delete the local tag using the following command:
70+
71+
git tag -d v1.7.2
72+
73+
Once you're confident that the tag and `main` branch are in good shape, push both to the remote:
74+
75+
git push origin main --tags
76+
77+
With the release tag created, the new release is automatically built and published on PyPI!

β€Ždocs/source/index.rstβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Contents
5959
design
6060
howto
6161
troubleshooting
62+
dev
6263
autoapi/index.rst
6364
cli
6465

β€Žpyproject.tomlβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ docs = [
5555
'sphinx-copybutton~=0.5.0',
5656
'sphinx-book-theme~=1.0',
5757
'sphinx-autoapi~=3.3.3',
58-
'sphinx-click~=4.0'
58+
'sphinx-click~=4.0',
59+
'myst_parser'
5960
]
6061

6162
[project.scripts]

0 commit comments

Comments
Β (0)