From 8f215c04fdb18aa9b386156e3e0938ab216323bb Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 8 Aug 2021 09:50:11 +0200 Subject: [PATCH] docs: release --- CHANGELOG.md | 2 +- docs/release.md | 18 ++++++++++++++++++ docs/release.sh | 20 ++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 docs/release.md create mode 100755 docs/release.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index cf6fbe8..6a24cfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,7 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.0.0] - 2020-02-14 - First release with matrix-client & http.server -[Unreleased]: https://github.com/nim65s/matrix-webhook/compare/v3.1.1...devel +[Unreleased]: https://github.com/nim65s/matrix-webhook/compare/v3.1.1...master [3.1.1]: https://github.com/nim65s/matrix-webhook/compare/v3.1.0...v3.1.1 [3.1.0]: https://github.com/nim65s/matrix-webhook/compare/v3.0.0...v3.1.0 [3.0.0]: https://github.com/nim65s/matrix-webhook/compare/v2.0.0...v3.0.0 diff --git a/docs/release.md b/docs/release.md new file mode 100644 index 0000000..ba59891 --- /dev/null +++ b/docs/release.md @@ -0,0 +1,18 @@ +# Publish a new release + +A github actions handle the build of the release archives, and push them to PyPI and Github Releases. +To trigger it, we just need to: + +1. use poetry to update the version number +2. update the changelog +3. git commit +4. git tag +5. git push +6. git push --tags + + +For this, an helper script is provided: + +```bash +./docs/release.sh [patch|minor|major|x.y.z] +``` diff --git a/docs/release.sh b/docs/release.sh new file mode 100755 index 0000000..c1cb632 --- /dev/null +++ b/docs/release.sh @@ -0,0 +1,20 @@ +#!/bin/bash -eux +# ./docs/release.sh [patch|minor|major|x.y.z] + +[[ $(basename $PWD) == docs ]] && cd .. + + +OLD=$(poetry version -s) + +poetry version $1 + +NEW=$(poetry version -s) +DATE=$(date +%Y-%m-%d) + +sed -i "/^## \[Unreleased\]/a \\\n## [$NEW] - $DATE" CHANGELOG.md +sed -i "/^\[Unreleased\]/s/$OLD/$NEW/" CHANGELOG.md +sed -i "/^\[Unreleased\]/a [$NEW] https://github.com/nim65s/matrix-webhook/compare/v$OLD...v$NEW" CHANGELOG.md + +echo git add pyproject.toml CHANGELOG.md +echo git commit -m "Release v$NEW" +echo git tag -s "v$NEW" -m "Release v$NEW"