-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
53 lines (47 loc) · 1.46 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
default:
image: registry.gitlab.com/vstconsulting/images:ubuntu-v3
variables:
GET_SOURCES_ATTEMPTS: 3
ARTIFACT_DOWNLOAD_ATTEMPTS: 3
RESTORE_CACHE_ATTEMPTS: 3
CC: "ccache gcc"
stages:
- test
- release
run_tests:
stage: test
image: registry.gitlab.com/vstconsulting/images:ubuntu-v3
script:
- tox
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "external_pull_request_event"'
when: on_success
- if: '$CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_TAG == null'
when: on_success
- when: never
release:
stage: release
cache: {}
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $GIT_ACCESS_USER && $GIT_ACCESS_PASSWORD'
when: on_success
- when: never
before_script:
- url_host=`echo "${CI_REPOSITORY_URL}" | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
- git config user.name "${GITLAB_USER_NAME}"
- git config user.email "${GITLAB_USER_EMAIL}"
- git remote set-url origin "https://${GIT_ACCESS_USER}:${GIT_ACCESS_PASSWORD}@${url_host}"
script:
- bash autorelease.sh
release_pypi:
stage: release
image: registry.gitlab.com/vstconsulting/images:ubuntu-v3
rules:
- if: '$CI_COMMIT_TAG && $PYPI_UPLOAD_PASSWORD && $PYPI_UPLOAD_NAME'
when: on_success
- when: never
script:
- tox -e build
- twine upload -u ${PYPI_UPLOAD_NAME} -p ${PYPI_UPLOAD_PASSWORD} $(find dist/*.{tar.gz,whl})