summaryrefslogtreecommitdiffstats
path: root/scripts/publish.sh
blob: c779419c44f99de0672835835a5176becdcf24ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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 "$@"