-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
executable file
·72 lines (64 loc) · 2.42 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
##
## Copyright (c) 2020-2030 Translational Oncology at the Medical Center of the Johannes Gutenberg-University Mainz gGmbH.
##
## This file is part of Neofox
## (see https://github.com/tron-bioinformatics/neofox).
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.##
# this image contains multiple Python interpreters
image: python:3.11.9-bookworm
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
TOX_CACHE_DIR: "$CI_PROJECT_DIR/.tox"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
paths:
- $TOX_CACHE_DIR
before_script:
- apt-get update
- apt-get --assume-yes install gcc gfortran build-essential wget libfreetype6-dev libpng-dev libopenblas-dev
- python -V
- pip install poetry==1.8.2
stages:
- validation
- test
- deploy
check_version_changes:
stage: validation
script:
# if the version number does not change between this branch and develop it fails
- git fetch origin develop
- if git diff origin/develop -- pyproject.toml | grep version; then exit 0; else echo "Version needs to be increased!"; exit -1; fi
except:
- develop
- master
test:
stage: test
script:
- pip install virtualenv tox==3.23.0 tox-wheel==0.6.0
- tox
publish_package:
stage: deploy
script:
- pip install twine
- poetry install
- poetry build
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url https://gitlab.rlp.net/api/v4/projects/${CI_PROJECT_ID}/packages/pypi dist/*
only:
# deploys in private gitlab package repository only the develop branch, the master branch is published in PyPI
- develop