Skip to content

Commit

Permalink
add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Aug 8, 2023
1 parent 04aba35 commit 267daf8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Publish a cmeel 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]
```
22 changes: 22 additions & 0 deletions docs/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/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## [v$NEW] - $DATE" CHANGELOG.md
sed -i "/^\[Unreleased\]/s/$OLD/$NEW/" CHANGELOG.md
sed -i "/^\[Unreleased\]/a [v$NEW]: https://github.com/cmake-wheel/cmeel/compare/v$OLD...v$NEW" CHANGELOG.md

git add pyproject.toml CHANGELOG.md
git commit -m "Release v$NEW"
git tag -s "v$NEW" -m "Release v$NEW"
git push
git push --tags

0 comments on commit 267daf8

Please sign in to comment.