-
Notifications
You must be signed in to change notification settings - Fork 11
/
.gitlab-ci.yml
81 lines (71 loc) · 1.18 KB
/
.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
default:
image: 'cimg/python:3.9'
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
key:
files:
- poetry.lock
paths:
- .cache/pip
stages:
- test
- build
- release
.tox:
image: 'cimg/python:$PY_VERSION'
cache:
key:
prefix: $TOX_ENV
files:
- poetry.lock
paths:
- .tox
script:
- sudo apt update
- sudo apt install -y python3-distutils python3-apt
- pip install tox
- tox -e $TOX_ENV
build:
script:
- make deps
- make build
artifacts:
paths:
- dist/
when: always
test-py38:
extends: .tox
variables:
PY_VERSION: "3.8"
TOX_ENV: py38-test
test-py39:
extends: .tox
variables:
PY_VERSION: "3.9"
TOX_ENV: py39-test
build-release:
stage: build
artifacts:
paths:
- dist/
when: always
only:
- /^v[0-9]+\.[0-9]+\.[0-9]+.*/
except:
- branches
script:
- make deps
- make build
- shasum -a 256 dist/* > dist/checksums.txt
release-pypi:
stage: release
only:
- /^v[0-9]+\.[0-9]+\.[0-9]+.*/
except:
- branches
needs:
- build-release
script:
- poetry config pypi-token.pypi $PYPI_PASSWORD
- make publish