-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
33 lines (30 loc) · 928 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
stages:
- test
- deploy
test-mypy:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/python:3.9
stage: test
when: manual
script:
- pip install mypy numpy typing-extensions --quiet
- mypy src
test-pylint:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/python:3.9
stage: test
when: manual
script:
- pip install pylint numpy typing-extensions --quiet
- pylint src
pypi-upload:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/python:3.9
stage: deploy
rules:
- if: $CI_COMMIT_TAG
script:
- pip install build twine --quiet
# Build
- python -m build
# Upload to local package repository
- python -m twine upload --username "gitlab-ci-token" --password "${CI_JOB_TOKEN}" --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
# Upload to pypi.org
- python -m twine upload --username "__token__" --password "${PYPI_TOKEN}" dist/*