Skip to content

Commit

Permalink
ci: add create release action to ease releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsgruk committed Dec 3, 2024
1 parent 5e12462 commit 593f809
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/tag-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

export VERSION="${1:-}"

echo "$VERSION" | grep -qEo '[0-9]+\.[0-9]+\.[0-9]+'
if [ $? -ne 0 ]; then
echo "Invalid version number. Please use the format '0.2.0'"
exit 1
fi

# Bump version in pyproject.toml and sync the uv.lock file
sed -i 's/^\(version = \).*$/\1'\"$VERSION\"'/' pyproject.toml
uv sync

git add pyproject.toml uv.lock
git commit -m "chore: bump version to $VERSION"
git tag -a "$VERSION" -m "$VERSION"

git push origin main "$VERSION"
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,12 @@ ruff check --fix
# Format the code
ruff format
```

## Releasing

Once all the changes have been merged into `main` for a release, use the
[`.github/tag-release`](./.github/tag-release.sh) script to create a version bump commit in the
right format, create, **and push** the tag ready for release.

This could be automated with Github Actions - but commit signing gets a little complicated, so for
now it's just a script that can be run by maintainers.

0 comments on commit 593f809

Please sign in to comment.