From 9ec095fefd23cb887ea5cc8ecafa30595e96fa69 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 12 Sep 2024 18:16:22 +0100 Subject: [PATCH] Add release steps --- README.md | 6 +++++- RELEASING.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 RELEASING.md diff --git a/README.md b/README.md index 73fc551..8b6e96e 100644 --- a/README.md +++ b/README.md @@ -137,4 +137,8 @@ Before submitting a PR, make sure to lint your code: ``` ./scripts-dev/lint.sh -``` \ No newline at end of file +``` + +### Creating a new release + +See [RELEASING.md](RELEASING.md). \ No newline at end of file diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..d1ff4c5 --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,45 @@ +# Releasing `mscbot-python` + +To make a new release of `mscbot-python`, perform the following. + +1. Determine the new version number. This project follows [semantic versioning](https://semver.org/). Store the release version in an environment variable called `RELEASE_VERSION`. + + ``` + export RELEASE_VERSION=X.Y.Z + ``` + + **Note:** Do not include a `v` before the version number. + +1. Update `setup.py` with the new version number: + + ``` + sed -i "s/version=\"[0-9]\+\.[0-9]\+\.[0-9]\+\"/version=\"${RELEASE_VERSION}\"/" setup.py + ``` + +1. Stage, commit and push the changes: + + ``` + git add setup.py + git commit -m "$RELEASE_VERSION" + ``` + +1. Create a new git tag: + + ``` + git tag $RELEASE_VERSION -m "$RELEASE_VERSION" + ``` + +1. Push the tag to the repository: + + ``` + git push origin $RELEASE_VERSION + ``` + +1. [Create a new release](https://github.com/matrix-org/mscbot-python/releases/new) + on GitHub. + Select the tag that was just created and click "Generate release notes". + + **Note:** A docker image will be automatically created and uploaded to + DockerHub and the GitHub container repository when a release is published. + +1. Press "Publish release", and you're done! 🍾 \ No newline at end of file