aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/publish-to-pypi.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/publish-to-pypi.sh')
-rwxr-xr-xscripts/publish-to-pypi.sh39
1 files changed, 39 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 "$@"