-
Create release branch
-
Create and push the release branch from the latest
develop
git fetch git checkout -b release-X.X.X origin/develop git push -u origin release-X.X.X
-
Release-related changes are made via Pull Requests from feature branches into the new release branch
git checkout -b release-X.X.X-changes release-X.X.X git push -u origin release-X.X.X-changes
-
Make the release changes described below.
- MUST do:
- Version bumping: Change version from “X.X.Xb” to “X.X.X”. E.g. version=”0.2.0b” to version=”0.2.0”
stellargraph/version.py
meta.yaml
- Update expected versions of demo notebooks:
scripts/format_notebooks.py --default --overwrite demos/
- Update Changelog section header and "Full Changelog" link to point to specific version tag instead of
HEAD
. Note: these links will be broken until the tag is pushed later.
- Version bumping: Change version from “X.X.Xb” to “X.X.X”. E.g. version=”0.2.0b” to version=”0.2.0”
- CAN do:
- Minor bug fixes if necessary
- NEVER do:
- Add new features
- MUST do:
-
Commit and push the changes to
release-X.X.X-changes
git commit -m "Bump version" git push -u origin release-X.X.X-changes
-
Make a PR from
release-X.X.X-changes
intorelease-X.X.X
and merge once approved -
Once the
release-X.X.X
branch is ready to be merged, create a new Pull Request from the release branch intomaster
. This should only be used to exercise CI and for the rest of the team the approve that all necessary changes have been made for release, and not for doing the actual merge. The actual merge into master should be done locally in the next step.
-
-
Merge release branch into
master
locallyThis step gets your local
master
branch into release-ready state.Pull any changes into your local release branch
git checkout release-X.X.X git pull
Merge changes into
master
git checkout master git merge --no-ff release-X.X.X -m "Release X.X.X" git tag -a vX.X.X -m "Release X.X.X"
-
Upload to PyPI
NOTE: An account on PyPI is required to upload - create an account and ask a team member to add you to the organisation.
- Install build/upload requirements:
pip install wheel twine
- Build distribution files:
This will create files
python setup.py sdist bdist_wheel
stellargraph-<version>.tar.gz
andstellargraph-<version>-py3-none-any.whl
under thedist
directory. - Upload to PyPi
twine upload dist/stellargraph-<version>*
- Check upload is successful: https://pypi.org/project/stellargraph/
- Install build/upload requirements:
-
Upload to Conda Cloud
NOTE: An account on Conda Cloud is required to upload - create an account and ask a team member to add you to the organization.
NOTE: These instructions are taken from https://docs.anaconda.com/anaconda-cloud/user-guide/tasks/work-with-packages/)
-
Turn off auto-uploading
conda config --set anaconda_upload no
-
Build package
conda build .
NOTE: The Conda package is also built in CI, and uploaded to a GitHub Actions artifact in the "conda build" stage of the pipeline. It's possible to download this artifact to be uploaded in the following step, rather than building the conda package locally.
-
Upload to Anaconda Cloud in the “stellargraph” organization
conda build . --output # find the path to the package anaconda login anaconda upload -u stellargraph /path/to/conda-package.tar.bz2
-
-
Make release on GitHub
After successfully publishing to PyPi and Conda, we now want to make the release on GitHub.
- Temporarily turn off branch protection on the
master
branch. Ask a team member if you are unsure. - Push
master
branchgit push --follow-tags origin master
- Turn branch protection back on.
- Go to the tags on the GitHub stellargraph homepage: https://github.com/stellargraph/stellargraph/tags
- Next to the release tag, click the “...” button and select “create release”
- Add the title and text of the metadata: a title “Release X.X.X” and text copied from the changelog is good practice
- Click “Publish release”
- Temporarily turn off branch protection on the
-
Get
develop
into correct state for next development versionWe want the merge any of the changes made during the release back into
develop
, and make sure the new version indevelop
is correct.- Switch to
develop
branch:git checkout develop
- Increase the version: in
stellargraph/version.py
, change version fromX.X.X
toX.X+1.Xb
. E.g.__version__ = "0.2.0"
to__version__ = "0.3.0b"
. (To stay consistent we useb
to indicate “beta”, but python will accept any string after the number. In semantic versioning: first number for major release, second number for minor release, third number for hotfixes.)git add stellargraph/version.py # make sure things have the correct format and the notebooks are up to date black . scripts/format_notebooks.py --default --overwrite demos/ git commit -m "Bump version"
- Merge
master
intodevelop
and resolve conflict by using the new version indevelop
:git merge master
- Temporarily turn off branch protection on the
develop
branch. Ask a team member if you are unsure. - Push the merge commit (and the version change):
git push origin develop
- Turn branch protection back on.
- Switch to
-
Prompt Binder to generate the docker images
Binder uses a docker image to package up the state of a repository. It takes a long time to build, and is only built lazily, for the first user to click one of our "launch binder" buttons. It is your job to do this:
-
For the
master
branch:- Find any demo notebook on the
master
branch - Click the "launch binder" button (or just click this link)
- Wait for the "Starting repository: stellargraph/stellargraph" loading screen to switch to a Jupyter environment
- Find any demo notebook on the
-
For the release tag:
- Find the specific release version of documentation just built on readthedocs (eg:
v1.0.0
, not thestable
orlatest
version). - Navigate to any demo notebook in this documentation
- Click the "launch binder" button
- Wait for the "Starting repository: stellargraph/stellargraph" loading screen to switch to a Jupyter environment
- Find the specific release version of documentation just built on readthedocs (eg:
-
Gitflow Examples: https://gitversion.readthedocs.io/en/latest/git-branching-strategies/gitflow-examples/