-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
127 lines (110 loc) · 2.63 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
stages:
- tests
- build
- bump
- release
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
.tests: &tests
stage: tests
script:
- pip install -e .[all]
- pytest
#tests_python_36:
# <<: *tests
# image: diefans/python3.6-alpine-cython:0.1.0
tests_python_37:
<<: *tests
image: diefans/python3.7-alpine-cython:0.1.0
# failing: https://github.com/Tinche/cattrs/issues/46
tests_python_38:
<<: *tests
image: diefans/python3.8-alpine-cython:0.1.0
tests_python_39:
<<: *tests
image: diefans/python3.9-alpine-cython:0.2.0
.wheels: &wheels
stage: build
image: quay.io/pypa/manylinux2014_x86_64
script:
#- mkdir ./dist
- ./build_manylinux.sh
#- cp ./wheelhouse/buvar* ./dist
artifacts:
when: on_success
paths:
- dist
expire_in: 30 mins
wheels_python39_x86_64:
<<: *wheels
needs: [tests_python_39]
variables:
PLATFORM: manylinux2014_x86_64
PYTHON_VERSIONS: cp39-cp39
wheels_python38_x86_64:
<<: *wheels
needs: [tests_python_38]
variables:
PLATFORM: manylinux2014_x86_64
PYTHON_VERSIONS: cp38-cp38
wheels_python37_x86_64:
<<: *wheels
needs: [tests_python_37]
variables:
PLATFORM: manylinux2014_x86_64
PYTHON_VERSIONS: cp37-cp37m
sdist:
image: diefans/python3.9-alpine-cython:0.2.0
stage: build
needs:
- tests_python_37
- tests_python_38
- tests_python_39
artifacts:
when: on_success
paths:
- dist
expire_in: 30 mins
script:
- python setup.py sdist
bump:
image: python:3.8
stage: bump
only:
refs:
- master
before_script:
- pip install commitizen
# setup ssh
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- ssh-keyscan gitlab.com >> ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "${SSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add -
script:
- git config --global user.email "${CI_EMAIL}"
- git config --global user.name "${CI_USERNAME}"
- REPOSITORY_URL=$(echo $CI_REPOSITORY_URL | sed -r "s,.+@([^/]+)/,git@\\1:,")
- git remote set-url --push origin ${REPOSITORY_URL}
- test -n "$(git show-ref refs/heads/master)" && git branch -D master
- git checkout -b master
- cz bump
- git push origin master:$CI_COMMIT_REF_NAME
- git push origin $(cz version -p)
release:
image: python:3.8
stage: release
only:
- tags
dependencies:
- sdist
- wheels_python37_x86_64
- wheels_python38_x86_64
- wheels_python39_x86_64
before_script:
- pip install twine
script:
- ls -la ./dist