2021-08-08 03:50:11 -04:00
|
|
|
#!/bin/bash -eux
|
|
|
|
# ./docs/release.sh [patch|minor|major|x.y.z]
|
|
|
|
|
2021-08-27 17:59:49 -04:00
|
|
|
[[ $(basename "$PWD") == docs ]] && cd ..
|
2021-08-08 03:50:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
OLD=$(poetry version -s)
|
|
|
|
|
2021-08-27 17:59:49 -04:00
|
|
|
poetry version "$1"
|
2021-08-08 03:50:11 -04:00
|
|
|
|
|
|
|
NEW=$(poetry version -s)
|
|
|
|
DATE=$(date +%Y-%m-%d)
|
|
|
|
|
2021-08-27 18:06:38 -04:00
|
|
|
sed -i "/^## \[Unreleased\]/a \\\n## [v$NEW] - $DATE" CHANGELOG.md
|
2021-08-08 03:50:11 -04:00
|
|
|
sed -i "/^\[Unreleased\]/s/$OLD/$NEW/" CHANGELOG.md
|
2021-08-27 18:08:56 -04:00
|
|
|
sed -i "/^\[Unreleased\]/a [v$NEW]: https://github.com/nim65s/matrix-webhook/compare/v$OLD...v$NEW" CHANGELOG.md
|
2021-08-08 03:50:11 -04:00
|
|
|
|
2021-08-27 17:59:49 -04:00
|
|
|
git add pyproject.toml CHANGELOG.md
|
|
|
|
git commit -m "Release v$NEW"
|
|
|
|
git tag -s "v$NEW" -m "Release v$NEW"
|
2021-08-27 18:07:30 -04:00
|
|
|
git push
|
|
|
|
git push --tags
|