Skip to content
Snippets Groups Projects
Commit c2d49c00 authored by Torben Miny's avatar Torben Miny
Browse files

Merge branch 'feature/continuous_delivery' into 'master'

CI: Add continuous delivery (packaging and uploading to PyPI)

See merge request acplt/pyaas!41
parents 69668e1b 6a1cd1fb
No related branches found
No related tags found
1 merge request!41CI: Add continuous delivery (packaging and uploading to PyPI)
Pipeline #287118 passed
image: python:3.6
stages:
- build
- test
- package
- deploy
# Change pip's package cache directory to be inside the project directory to allow caching via Gitlab CI
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
COUCHDB_USER: "admin"
COUCHDB_PASSWORD: "yo0Quai3"
services:
- couchdb:2.3
cache:
paths:
- .cache/pip
......@@ -16,8 +16,18 @@ cache:
before_script:
- python -V # Print out python version for debugging
# Our main CI test script
test:
stage: test
only: [branches, tags, merge_requests]
inherit:
variables: ["PIP_CACHE_DIR"]
variables:
COUCHDB_USER: "admin"
COUCHDB_PASSWORD: "yo0Quai3"
services:
- couchdb:2.3
script:
# Install python testing dependencies
- pip install --cache-dir="$PIP_CACHE_DIR" mypy pycodestyle unittest-xml-reporting coverage
......@@ -38,4 +48,29 @@ test:
reports:
junit: testreports/*.xml
only: [branches, tags, merge_requests]
# Use setup.py to build a source distribution package
package:
stage: package
script:
- python setup.py sdist
artifacts:
paths:
- dist/*.tar.gz
# Publish package to PyPI for every vX.X.X tag
publish:
stage: deploy
only:
- /^v\d+(\.\d+)*$/
except:
- branches
dependencies:
- package
script:
- pip install --cache-dir="$PIP_CACHE_DIR" twine
- twine upload dist/*.tar.gz
......@@ -24,7 +24,7 @@ setuptools.setup(
long_description=long_description,
long_description_content_type="text/markdown",
url="https://git.rwth-aachen.de/acplt/pyaas",
packages=setuptools.find_packages(),
packages=setuptools.find_packages(exclude=["test", "test.*"]),
zip_safe=False,
package_data={
"aas": ["py.typed"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment