Skip to content

Commit

Permalink
v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluemi committed Dec 19, 2024
1 parent c61c595 commit 644f798
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions python/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -e

# get new version from __init__.py
new_version=$(grep --color=never -oP '__version__\s*=\s*"\K[0-9]+\.[0-9]+\.[0-9]+' "src/deglib/__init__.py")
echo "detected new version: $new_version"

# get old version from pypi
old_version=$(curl -s "https://pypi.org/pypi/deglib/json" | jq -r '.info.version')

# compare versions
if [ "$old_version" = "$new_version" ]; then
echo "ERROR: current version equals version on pypi"
read -p "have you changed the version in \"src/deglib/__init__.py\"? y/[n]: " answer
if [ "$answer" != "y" ]; then
exit 0
fi
fi

# publish
git add -A && git commit -m "v$new_version" && git tag -a "v$new_version" -m "v$new_version"
git push && git push origin --tags

0 comments on commit 644f798

Please sign in to comment.