2018-06-25 13:15:32 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2020-04-29 14:48:44 +00:00
|
|
|
VERSION_FILE="starlette/__init__.py"
|
|
|
|
|
2018-06-25 13:15:32 +00:00
|
|
|
if [ -d 'venv' ] ; then
|
2020-04-29 14:48:44 +00:00
|
|
|
PREFIX="venv/bin/"
|
|
|
|
else
|
|
|
|
PREFIX=""
|
2018-06-25 13:15:32 +00:00
|
|
|
fi
|
|
|
|
|
2020-04-29 14:48:44 +00:00
|
|
|
if [ ! -z "$GITHUB_ACTIONS" ]; then
|
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "GitHub Action"
|
2018-12-06 10:52:38 +00:00
|
|
|
|
2020-04-29 14:48:44 +00:00
|
|
|
VERSION=`grep __version__ ${VERSION_FILE} | grep -o '[0-9][^"]*'`
|
2018-06-25 13:15:32 +00:00
|
|
|
|
2020-04-29 14:48:44 +00:00
|
|
|
if [ "refs/tags/${VERSION}" != "${GITHUB_REF}" ] ; then
|
|
|
|
echo "GitHub Ref '${GITHUB_REF}' did not match package version '${VERSION}'"
|
2019-11-15 12:06:59 +00:00
|
|
|
exit 1
|
2020-04-29 14:48:44 +00:00
|
|
|
fi
|
2019-11-15 12:06:59 +00:00
|
|
|
fi
|
|
|
|
|
2020-04-29 14:48:44 +00:00
|
|
|
set -x
|
2018-06-25 13:15:32 +00:00
|
|
|
|
|
|
|
${PREFIX}twine upload dist/*
|
2020-04-29 14:48:44 +00:00
|
|
|
${PREFIX}mkdocs gh-deploy --force
|