Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Commit 22e8b2a

Browse files
sync publish script with starlette (#132)
1 parent d6806ac commit 22e8b2a

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

scripts/publish

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
11
#!/bin/sh -e
22

3-
export VERSION=`cat broadcaster/__init__.py | grep __version__ | sed "s/__version__ = //" | sed "s/'//g"`
4-
export PREFIX=""
3+
VERSION_FILE="broadcaster/__init__.py"
4+
55
if [ -d 'venv' ] ; then
6-
export PREFIX="venv/bin/"
6+
PREFIX="venv/bin/"
7+
else
8+
PREFIX=""
79
fi
810

9-
scripts/clean
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"
1014

11-
if ! command -v "${PREFIX}twine" &>/dev/null ; then
12-
echo "Unable to find the 'twine' command."
13-
echo "Install from PyPI, using '${PREFIX}pip install twine'."
14-
exit 1
15-
fi
15+
VERSION=`grep __version__ ${VERSION_FILE} | grep -o '[0-9][^"]*'`
1616

17-
if ! command -v "${PREFIX}wheel" &>/dev/null ; then
18-
echo "Unable to find the 'wheel' command."
19-
echo "Install from PyPI, using '${PREFIX}pip install wheel'."
17+
if [ "refs/tags/${VERSION}" != "${GITHUB_REF}" ] ; then
18+
echo "GitHub Ref '${GITHUB_REF}' did not match package version '${VERSION}'"
2019
exit 1
20+
fi
2121
fi
2222

23-
find broadcaster -type f -name "*.py[co]" -delete
24-
find broadcaster -type d -name __pycache__ -delete
23+
set -x
2524

26-
${PREFIX}python setup.py sdist bdist_wheel
2725
${PREFIX}twine upload dist/*
28-
#${PREFIX}mkdocs gh-deploy
29-
30-
echo "You probably want to also tag the version now:"
31-
echo "git tag -a ${VERSION} -m 'version ${VERSION}'"
32-
echo "git push --tags"
3326

34-
scripts/clean

0 commit comments

Comments
 (0)