-
Notifications
You must be signed in to change notification settings - Fork 155
/
.gitlab-ci.yml
40 lines (37 loc) · 869 Bytes
/
.gitlab-ci.yml
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
33
34
35
36
37
38
39
40
image: python:3.11
stages:
- build
- release
test:
variables:
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit"
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pip"
cache:
key: "${CI_JOB_NAME}"
paths:
- .cache/pre-commit
- .cache/pip
- venv
stage: build
before_script:
- pip install virtualenv poetry pre-commit urllib3==1.26.15
- virtualenv venv
- source venv/bin/activate
- poetry config virtualenvs.create false
- poetry install --no-root
script:
- pre-commit run -a --hook-stage manual
- pytest
pypi:
variables:
TWINE_USERNAME: "__token__"
stage: release
needs: [test]
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+.\d+.\d+$/
when: on_success
script:
- pip install -U twine gitchangelog pystache poetry
- gitchangelog
- poetry build
- twine upload dist/*