docs: release

This commit is contained in:
Guilhem Saurel 2021-08-08 09:50:11 +02:00
parent 7f20fb7ff9
commit 8f215c04fd
3 changed files with 39 additions and 1 deletions

18
docs/release.md Normal file
View file

@ -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]
```

20
docs/release.sh Executable file
View file

@ -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"