diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2026-03-20 21:12:32 -0400 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2026-03-21 13:37:31 -0400 |
| commit | 91054e89cd96df335a754acba757a7f13880f690 (patch) | |
| tree | e9ee9053a6ab5c6bf81fb1ba4499c1c8cf487217 /scripts | |
| parent | Fix subprocess signal handling logic on linux with ash/dash (diff) | |
| download | taskipy2-91054e89cd96df335a754acba757a7f13880f690.zip | |
Add pypi publish job and release commit script
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/publish-to-pypi.sh | 39 | ||||
| -rwxr-xr-x | scripts/release-commit.sh | 39 |
2 files changed, 78 insertions, 0 deletions
diff --git a/scripts/publish-to-pypi.sh b/scripts/publish-to-pypi.sh new file mode 100755 index 0000000..c779419 --- /dev/null +++ b/scripts/publish-to-pypi.sh @@ -0,0 +1,39 @@ +#!/bin/sh +set -e + +PYPI_TOKEN="" + +main() { + parse_args "$@" + uv build + uv publish --token "$PYPI_TOKEN" +} + +usage() { + echo "Usage: $0 [-h|--help] -t|--token TOKEN" + echo "" + echo "Options:" + echo " -h, --help Show this help message and exit" + echo " -t, --token Required PyPI token for publishing the package" +} + +parse_args() { + while [ $# -gt 0 ]; do + case "$1" in + -h | --help) + usage + exit 0 + ;; + -t | --token) + PYPI_TOKEN="$2" + shift 2 + ;; + *) + usage + exit 1 + ;; + esac + done +} + +main "$@" diff --git a/scripts/release-commit.sh b/scripts/release-commit.sh new file mode 100755 index 0000000..be43d8b --- /dev/null +++ b/scripts/release-commit.sh @@ -0,0 +1,39 @@ +#!/bin/sh +set -e + +main() { + if [ $# -ne 1 ]; then + echo "Usage: $0 <version>" + exit 1 + fi + + VERSION="$1" + DATE=$(date +%Y-%m-%d) + + sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml + sed -i "s/^## \[Unreleased\]/## [$VERSION] - $DATE/" CHANGELOG.md + + git add pyproject.toml CHANGELOG.md + git commit -m "Release version v$VERSION" + git tag "$VERSION" + + git show HEAD + echo "" + git log --oneline -5 + echo "" + + printf "Push commit and tag v%s? [y/N] " "$VERSION" + read -r CONFIRM + case "$CONFIRM" in + [yY]) ;; + *) + echo "Aborted." + exit 1 + ;; + esac + + git push + git push origin "$VERSION" +} + +main "$@" |