This repository has been archived by the owner on Jul 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
.gitlab-ci.yml
74 lines (65 loc) · 1.87 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
73
74
include:
- project: "epi2melabs/ci-templates"
file: "push-github.yaml"
- project: "epi2melabs/ci-templates"
file: "push-conda.yaml"
image: ${UBUNTUIMAGE}:20.04
.prep-image: &prep-image |
export DEBIAN_FRONTEND=noninteractive
apt update -qq
apt install -y --no-install-recommends make wget python3-all-dev python3-venv
stages:
- test
- build
- prerelease
- release
- postrelease
# Insist that the version in __init__.py matches the git tag
.check-versions: &check-versions |
PYVER="v"$(grep "__version__ = " ${CI_PROJECT_NAME}/__init__.py | awk '{gsub("\"","",$3); print $3}')
TAGVER=${CI_COMMIT_TAG}
if [[ "${PYVER}" != "${TAGVER}" ]]; then
echo "Mismatching TAG and PACKAGE versions:"
echo " - TAG:'$TAGVER'"
echo " - PACKAGE:'$TAGVER'"
exit 1
else
echo "TAG and PACKAGE versions agree: '${PYVER}'"
fi
# Insist a CHANGELOG entry has been made for tags
.check-changelog: &check-changelog |
TAGVER=${CI_COMMIT_TAG}
MATCHES=$(grep -c "## \[${TAGVER}\]" CHANGELOG.md || exit 0)
if [[ "${MATCHES}" != "1" ]]; then
echo "Expected one match to '${CI_COMMIT_TAG}' in CHANGELOG, found ${MATCHES}"
exit 1
else
echo "Found CHANGELOG.md entry for tag"
fi
test:
stage: test
script:
- *prep-image
- make test
- make docs
- make sdist
artifacts:
paths:
- dist/*.tar.gz
deploy-checks:
stage: prerelease
script:
- *check-versions
- *check-changelog
rules:
- if: '$CI_COMMIT_TAG =~ /^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$/'
conda:
tags:
- large_ram
extends:
- .deploy-conda
before_script:
- *prep-image
- export CONDA_PKG=${CI_PROJECT_NAME}
- export CONDA_PKG_VERSION=${CI_COMMIT_TAG/v/}
- cd conda