Debian Codegraph @

scripts/publish

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