forked from streamlink/streamlink
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-pypi.sh
More file actions
executable file
·32 lines (25 loc) · 858 Bytes
/
Copy pathdeploy-pypi.sh
File metadata and controls
executable file
·32 lines (25 loc) · 858 Bytes
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
#!/usr/bin/env bash
shopt -s nullglob
set -e
version=$(python setup.py --version)
dist_dir=${STREAMLINK_DIST_DIR:-dist}
if [[ "${1}" = "-n" ]] || [[ "${1}" = "--dry-run" ]]; then
echo "deploy: dry-run (${version})" >&2
for file in "${dist_dir}"/streamlink-"${version}"{.tar.gz,-*.whl}{,.asc}; do
echo "${file}" >&2
done
else
if ! python -m pip -q show twine; then
echo "deploy: missing dependency 'twine'" >&2
exit 1
fi
if [[ -z "${PYPI_USER}" ]] || [[ -z "${PYPI_PASSWORD}" ]]; then
echo "deploy: missing PYPI_USER or PYPI_PASSWORD env var" >&2
exit 1
fi
echo "deploy: Uploading files to PyPI (${version})" >&2
twine upload \
--username "${PYPI_USER}" \
--password "${PYPI_PASSWORD}" \
"${dist_dir}"/streamlink-"${version}"{.tar.gz,-*.whl}{,.asc}
fi