Skip to content

Commit cc2ca0c

Browse files
committed
update guide for making a release
1 parent a7bf2c3 commit cc2ca0c

1 file changed

Lines changed: 26 additions & 65 deletions

File tree

README.dev.md

Lines changed: 26 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -160,86 +160,47 @@ Updating the version of the NPLinker package is done with make command `update-v
160160
make update-version CURRENT_VERSION=0.0.1 NEW_VERSION=0.0.2
161161
```
162162

163-
## Making a release
164-
165-
This section describes how to make a release in 3 parts:
166-
167-
1. preparation
168-
1. making a release on PyPI
169-
1. making a release on GitHub
170-
171-
### (1/3) Preparation
172-
173-
1. Update the <CHANGELOG.md> (don't forget to update links at bottom of page)
174-
2. Verify that the information in `CITATION.cff` is correct, and that `.zenodo.json` contains equivalent data
175-
3. Make sure the [version has been updated](#versioning).
176-
4. Run the unit tests with `pytest -v`
163+
This command will update the version in the following files:
164+
- `src/nplinker/__init__.py`
165+
- `pyproject.toml`
166+
- `CITATION.cff`
177167

178-
### (2/3) PyPI
179-
180-
In a new terminal, without an activated virtual environment or an env directory:
168+
## Making a release
181169

182-
```shell
183-
# prepare a new directory
184-
cd $(mktemp -d nplinker.XXXXXX)
170+
This section describes how to make a release in 2 parts:
185171

186-
# fresh git clone ensures the release has the state of origin/main branch
187-
git clone https://github.com/NPLinker/nplinker .
172+
1. Create Github release
173+
2. Publish to Pypi
188174

189-
# prepare a clean virtual environment and activate it
190-
python3 -m venv env
191-
source env/bin/activate
175+
### (1/2) Create Github release
192176

193-
# make sure to have a recent version of pip and setuptools
194-
python3 -m pip install --upgrade pip setuptools
177+
We use the Github action [Draft or publish Github release
178+
](https://github.com/NPLinker/nplinker/actions/workflows/publish_gh_release.yml) to create a Github release.
195179

196-
# install runtime dependencies and publishing dependencies
197-
python3 -m pip install --no-cache-dir .
198-
python3 -m pip install --no-cache-dir .[publishing]
180+
Click the right corner `Run workflow` button, then fill in the current version number and new version number, and choose `publish` to publish Github release, then click the `Run workflow` button.
199181

200-
# clean up any previously generated artefacts
201-
rm -rf nplinker.egg-info
202-
rm -rf dist
182+
The action will first update the version with the command `make update-version`. Then it will generate a release notes and update the `CHANGELOG.md` file with the notes. After that, the action will commit and push the changes. In the end, the action will create a Github release with the new version number and create a tag for the release.
203183

204-
# create the source distribution and the wheel
205-
python3 -m build
184+
After the action is finished successfully, you can go to the [release page](https://github.com/NPLinker/nplinker/releases) to check the release.
206185

207-
# upload to test pypi instance (requires credentials)
208-
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
209-
```
186+
This repository uses the GitHub-Zenodo integration, the new Github release will trigger Zenodo into making a snapshot of the repository and sticking a DOI on it. Check the [Zenodo page](https://zenodo.org/records/14723594) to see the new snapshot.
210187

211-
Visit
212-
[https://test.pypi.org/project/nplinker](https://test.pypi.org/project/nplinker)
213-
and verify that your package was uploaded successfully. Keep the terminal open, we'll need it later.
188+
### (2/2) Publish to Pypi
214189

215-
In a new terminal, without an activated virtual environment or an env directory:
190+
You can publish the package to pypi with the following steps:
216191

217192
```shell
218-
cd $(mktemp -d nplinker-test.XXXXXX)
193+
# Go to your local nplinker repository
194+
cd path-to-nplinker-repo
219195

220-
# prepare a clean virtual environment and activate it
221-
python3 -m venv env
222-
source env/bin/activate
196+
# Clean the repository
197+
make clean
223198

224-
# make sure to have a recent version of pip and setuptools
225-
pip install --upgrade pip setuptools
199+
# Build the source distribution and the wheel
200+
make build
226201

227-
# install from test pypi instance:
228-
python3 -m pip -v install --no-cache-dir \
229-
--index-url https://test.pypi.org/simple/ \
230-
--extra-index-url https://pypi.org/simple nplinker
202+
# Publish to pypi
203+
make publish
231204
```
232205

233-
Check that the package works as it should when installed from pypitest.
234-
235-
Then upload to pypi.org with:
236-
237-
```shell
238-
# Back to the first terminal,
239-
# FINAL STEP: upload to PyPI (requires credentials)
240-
twine upload dist/*
241-
```
242-
243-
### (3/3) GitHub
244-
245-
Don't forget to also make a [release on GitHub](https://github.com/NPLinker/nplinker/releases/new). If your repository uses the GitHub-Zenodo integration this will also trigger Zenodo into making a snapshot of your repository and sticking a DOI on it.
206+
After publishing to pypi, you can check the [pypi page](https://pypi.org/project/nplinker/#history) to see the new version.

0 commit comments

Comments
 (0)