-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
46 lines (42 loc) · 1.05 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
stages:
- build
- publish
variables:
PACKAGE_NAME: "inia"
GITLAB_REGISTRY: "https://gitlab.grnet.gr/api/v4/projects/${CI_PROJECT_ID}/packages/pypi"
GITLAB_TOKEN: $CI_JOB_TOKEN
cache:
paths:
- .cache/pip
build-package:
stage: build
image: python:3.10
script:
- python -m venv venv
- source venv/bin/activate
- pip install --upgrade pip setuptools wheel
- pip install -r requirements.txt
- python setup.py sdist bdist_wheel
artifacts:
paths:
- dist/
only:
- pushes
publish-to-package-registry:
stage: publish
image: python:3.10
script:
- python -m venv venv
- source venv/bin/activate
- pip install --upgrade pip twine
- echo "[distutils]" > ~/.pypirc
- echo "index-servers = gitlab" >> ~/.pypirc
- echo "[gitlab]" >> ~/.pypirc
- |
echo "repository: ${GITLAB_REGISTRY}" >> ~/.pypirc
echo "username: gitlab-ci-token" >> ~/.pypirc
- |
echo "password: ${GITLAB_TOKEN}" >> ~/.pypirc
- twine upload --repository gitlab dist/* --verbose
only:
- tags