-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
53 lines (44 loc) · 1.23 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
# Global --------------------------
variables:
PIP_DOWNLOAD_DIR: ".pip"
cache:
key: "${CI_JOB_NAME}"
paths:
- .cache/pip
- .venv
stages:
- pubs
- pypi-pub
# Jobs templates ------------------
.install-deps-template: &install-deps
before_script:
- sed -i "/^version/s/\(.*\)/version = \"$CI_COMMIT_REF_NAME\"/" pyproject.toml
- cat pyproject.toml
- curl -sSL https://install.python-poetry.org | python3 -
- $HOME/.local/bin/poetry config virtualenvs.in-project true
- $HOME/.local/bin/poetry config repositories.gl https://gitlab.com/api/v4/projects/27867877/packages/pypi
- $HOME/.local/bin/poetry config --list
- $HOME/.local/bin/poetry install --no-dev -vv
.pub-template: &pub
<<: *install-deps
stage: pubs
script:
- env
- $HOME/.local/bin/poetry build
- $HOME/.local/bin/poetry publish -r gl -u "$GITLAB_PYPI_NAME" -p "$GITLAB_PYPI_PWD"
only:
- tags
.pypi-template: &pypi
<<: *install-deps
stage: pypi-pub
script:
- $HOME/.local/bin/poetry build
- POETRY_PYPI_TOKEN_PYPI=$PYPI_TOKEN $HOME/.local/bin/poetry publish
only:
- /^[0-9]+[.][0-9]+([.][0-9]+)?$/
py-pub:
<<: *pypi
image: python:3.8
python-pub:
<<: *pub
image: python:3.8