This repository was archived by the owner on Aug 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-21
lines changed Expand file tree Collapse file tree 1 file changed +13
-21
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh -e
2
2
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
+
5
5
if [ -d ' venv' ] ; then
6
- export PREFIX=" venv/bin/"
6
+ PREFIX=" venv/bin/"
7
+ else
8
+ PREFIX=" "
7
9
fi
8
10
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"
10
14
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][^"]*' `
16
16
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} '"
20
19
exit 1
20
+ fi
21
21
fi
22
22
23
- find broadcaster -type f -name " *.py[co]" -delete
24
- find broadcaster -type d -name __pycache__ -delete
23
+ set -x
25
24
26
- ${PREFIX} python setup.py sdist bdist_wheel
27
25
${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"
33
26
34
- scripts/clean
You can’t perform that action at this time.
0 commit comments