Debian Codegraph @

scripts/publish

raw
1 #!/bin/sh -e
2
3 VERSION_FILE="httpx/__version__.py"
4
5 if [ -d 'venv' ] ; then
6 PREFIX="venv/bin/"
7 else
8 PREFIX=""
9 fi
10
11 if [ ! -z "$GITHUB_ACTIONS" ]; then
12 git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
13 git config --local user.name "GitHub Action"
14
15 VERSION=`grep __version__ ${VERSION_FILE} | grep -o '[0-9][^"]*'`
16
17 if [ "refs/tags/${VERSION}" != "${GITHUB_REF}" ] ; then
18 echo "GitHub Ref '${GITHUB_REF}' did not match package version '${VERSION}'"
19 exit 1
20 fi
21 fi
22
23 set -x
24
25 ${PREFIX}twine upload dist/*
26 ${PREFIX}mkdocs gh-deploy --force