Skip to content

Commit 6e7e3ca

Browse files
committed
MNT add a publishing script
1 parent e39db08 commit 6e7e3ca

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

publish.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
# publish this package
4+
5+
## Define the release
6+
7+
STARTED=$(date)
8+
PACKAGE=$(python setup.py --name)
9+
RELEASE=$(python setup.py --version)
10+
echo "# ($(date)) PACKAGE: ${PACKAGE}"
11+
echo "# ($(date)) RELEASE: ${RELEASE}"
12+
13+
if [[ ${RELEASE} == *dirty || ${RELEASE} == *+* ]] ; then
14+
echo "# version: ${RELEASE} not ready to publish"
15+
exit 1
16+
fi
17+
18+
echo "# ($(date)) - - - - - - - - - - - - - - - - - - - - - - build for PyPI"
19+
20+
## PyPI Build and upload::
21+
22+
echo "# ($(date)) Building for upload to PyPI"
23+
python setup.py sdist bdist_wheel
24+
echo "# ($(date)) Built for PyPI"
25+
26+
echo "# ($(date)) - - - - - - - - - - - - - - - - - - - - - - upload to PyPI"
27+
28+
twine upload "dist/${PACKAGE}-${RELEASE}*"
29+
echo "# ($(date)) Uploaded to PyPI"
30+
31+
echo "# (${STARTED}) started publishing script"
32+
echo "# ($(date)) finished publishing script"

0 commit comments

Comments
 (0)