diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f78884c5..80af54ef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ image: quay.io/python-devs/ci-image stages: - test - codecov + - deploy qa: script: @@ -34,3 +35,10 @@ codecov: script: - codecov -t $CODECOV_TOKEN when: on_success + +release: + stage: deploy + only: + - /^\d+\.\d+(\.\d+)?([abc]\d*)?$/ + script: + - tox -e release diff --git a/release.sh b/release.sh deleted file mode 100755 index 26346cc7..00000000 --- a/release.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source .tox/release/bin/activate -pip wheel -w wheels . -rm -rf artifacts -mkdir artifacts -mv wheels/importlib_resources*.whl artifacts/ -python setup.py sdist -mv dist/importlib_resources*.tar.gz artifacts/ -rm -rf wheels dist diff --git a/tox.ini b/tox.ini index 32ec1da5..29c26a95 100644 --- a/tox.ini +++ b/tox.ini @@ -66,7 +66,17 @@ exclude = # to expose the version string and to handle Python 2/3 compatibility. importlib_resources/__init__.py + [testenv:release] basepython = python3 -whitelist_externals = ./release.sh -commands = ./release.sh +deps = + twine + wheel + setuptools + keyring +passenv = + TWINE_USERNAME + TWINE_PASSWORD +commands = + python setup.py sdist bdist_wheel + python -m twine {posargs} upload dist/*