Build release archives and wheels from the CI

This commit is contained in:
Martin Pépin 2020-07-18 18:35:22 +02:00
parent 57b527a137
commit b654b570e5
No known key found for this signature in database
GPG key ID: E7520278B1774448

View file

@ -3,6 +3,7 @@ image: python
stages:
- linters
- tests
- release
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/vendor/pip"
@ -11,6 +12,10 @@ cache:
paths:
- vendor
# ---
# Linters
# ---
linters:
stage: linters
before_script:
@ -21,6 +26,10 @@ linters:
- isort --check --diff .
- flake8 --exit-zero authens
# ---
# Test suite
# ---
before_script:
- mkdir -p vendor/{apt,pip}
- apt-get update -q && apt-get -o dir::cache::archives="vendor/apt" install -yqq python3-dev libldap2-dev libsasl2-dev
@ -52,3 +61,21 @@ python38:
script:
- tox -e py38-django22
- tox -e py38-django30
# ---
# Release artifacts
# ---
build_wheels:
stage: release
image: python
only:
- tags
artifacts:
paths:
- dist/*
when: on_success
before_script:
- pip install --upgrade setuptools wheel
script:
- python setup.py sdist bdist_wheel