diff options
author | Elvis Pranskevichus <elvis@magic.io> | 2018-03-30 19:47:52 -0400 |
---|---|---|
committer | Elvis Pranskevichus <elvis@magic.io> | 2018-03-30 20:50:17 -0400 |
commit | a1b19e1d10896f3ac2ce0b97c2bf24e0c1c4520f (patch) | |
tree | 283ca8f24adc74d1092cf24b7bd66174a0014b51 /.ci/travis-release.sh | |
parent | 0e715340a78863d973302981ab98b232d6f51735 (diff) | |
download | immutables-a1b19e1d10896f3ac2ce0b97c2bf24e0c1c4520f.tar.gz immutables-a1b19e1d10896f3ac2ce0b97c2bf24e0c1c4520f.zip |
CI integration
Diffstat (limited to '.ci/travis-release.sh')
-rwxr-xr-x | .ci/travis-release.sh | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/.ci/travis-release.sh b/.ci/travis-release.sh new file mode 100755 index 0000000..60d1c62 --- /dev/null +++ b/.ci/travis-release.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -e -x + + +if [ -z "${TRAVIS_TAG}" ]; then + # Not a release + exit 0 +fi + + +PACKAGE_VERSION=$(python ".ci/package-version.py") +PYPI_VERSION=$(python ".ci/pypi-check.py" "${PYMODULE}") + +if [ "${PACKAGE_VERSION}" == "${PYPI_VERSION}" ]; then + echo "${PYMODULE}-${PACKAGE_VERSION} is already published on PyPI" + exit 0 +fi + +# Check if all expected wheels have been built and uploaded. +release_platforms=( + "macosx_10_??_x86_64" + "manylinux1_i686" + "manylinux1_x86_64" + "win32" + "win_amd64" +) + +P="${PYMODULE}-${PACKAGE_VERSION}" +expected_wheels=() + +for pyver in ${RELEASE_PYTHON_VERSIONS}; do + pyver="${pyver//./}" + abitag="cp${pyver}-cp${pyver}m" + for plat in "${release_platforms[@]}"; do + expected_wheels+=("${P}-${abitag}-${plat}.whl") + done +done + +rm -rf dist/*.whl dist/*.tar.* +python setup.py sdist +python ".ci/s3-download-release.py" --destdir=dist/ "${P}" + +_file_exists() { [[ -f $1 ]]; } + +for distfile in "${expected_wheels[@]}"; do + if ! _file_exists dist/${distfile}; then + echo "Expected wheel ${distfile} not found." + exit 1 + fi +done + +python -m twine upload dist/*.whl dist/*.tar.* + +.ci/travis-publish-docs.sh |