-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
43 lines (39 loc) · 1.06 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
stages:
- test
- release
services: []
include:
- component: gitlab.com/thelabnyc/thelab-ci-components/[email protected]
- component: gitlab.com/thelabnyc/thelab-ci-components/[email protected]
test:
stage: test
image: "registry.gitlab.com/thelabnyc/python:${PYIMAGE}"
script:
- pip install tox
- tox
parallel:
matrix:
- PYIMAGE: py310
TOX_SKIP_ENV: "^(?!py310)"
- PYIMAGE: py311
TOX_SKIP_ENV: "^(?!py311)"
- PYIMAGE: py312
TOX_SKIP_ENV: "^(?!py312)"
publish-to-pypi:
stage: release
image: registry.gitlab.com/thelabnyc/python:py313
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED
environment:
name: release
deployment_tier: production
script:
- pip install twine
# Build package
- poetry build
# Publish to Gitlab's package registry
- export TWINE_USERNAME=gitlab-ci-token
- export TWINE_PASSWORD=${CI_JOB_TOKEN}
- python -m twine upload
--repository-url https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/pypi
dist/*