This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathdeploy.sh
65 lines (56 loc) · 2.14 KB
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
make_docs() {
rm -f docs-source/smartsheet.rst
rm -f docs-source/smartsheet.models.rst
rm -f docs-source/modules.rst
sphinx-apidoc -o docs-source smartsheet
rm -rf docs-source/_build
sphinx-build -b html -d docs-source/_build/doctrees docs-source/. docs-source/_build/html
rm -rf docs
cp -a docs-source/_build/html docs/
cp .nojekyll docs
}
install_packages() {
pip install enum34 requests six python-dateutil
pip install sphinx
pip install sphinx_rtd_theme
pip install setuptools-scm
pip install gitchangelog mako
pip install collective.checkdocs
pip install twine
}
set -e
export RELEASE_TAG=${deploy}
install_packages
echo "beginning deploy..."
# git configuration
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Automated Build"
echo "docs 1st pass..."
make_docs
git add docs/*
git commit -am "chg: doc: build ${RELEASE_TAG} docs 1st pass"
git push https://${GH_USER}:${GH_ACCESS_TOKEN}@github.com/smartsheet-platform/smartsheet-python-sdk.git \
HEAD:${TRAVIS_BRANCH} > /dev/null 2>&1
echo "updating release tag..."
git tag ${RELEASE_TAG} -m "Release ${RELEASE_TAG}"
git push https://${GH_USER}:${GH_ACCESS_TOKEN}@github.com/smartsheet-platform/smartsheet-python-sdk.git HEAD:${TRAVIS_BRANCH} --tags > /dev/null 2>&1
echo "building distribution..."
# note this must be done immediately after the tag and before other files are committed
# to avoid setuptools_scm from designating the distribution with an interim dev tag.
python setup.py checkdocs
python setup.py sdist bdist_wheel
echo "uploading distribution..."
twine upload -u "smartsheet-platform" -p ${PYPI_PASSWORD} dist/*
echo "docs final pass..."
make_docs
git add docs/*
git commit -am "chg: doc: build ${RELEASE_TAG} final docs"
git push https://${GH_USER}:${GH_ACCESS_TOKEN}@github.com/smartsheet-platform/smartsheet-python-sdk.git \
HEAD:${TRAVIS_BRANCH} > /dev/null 2>&1
echo "update CHANGELOG.md..."
gitchangelog
git add CHANGELOG.md
git commit -am "chg: doc: update CHANGELOG.md"
git push https://${GH_USER}:${GH_ACCESS_TOKEN}@github.com/smartsheet-platform/smartsheet-python-sdk.git \
HEAD:${TRAVIS_BRANCH} > /dev/null 2>&1