-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
63 lines (56 loc) · 1.2 KB
/
.gitlab-ci.yml
File metadata and controls
63 lines (56 loc) · 1.2 KB
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
image: python:3.8
stages:
- test
- build
- deploy
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- /.composer-cache/
unittest:
stage: test
script:
- pip install poetry
- poetry install
- python -m unittest -v comlipy.tests.suite
build:
stage: build
dependencies:
- unittest
before_script:
- pip install poetry
script:
# use '|' as sed delimiter because our repository url ($CI_PROJECT_URL) contains '/'
- sed -i -E "s|\[([^]]*)\]\((/[^\)]*)\)|\[\1\]\(${CI_PROJECT_URL}/blob/master\2\)|g" README.md
- poetry build
artifacts:
paths:
- dist/
expire_in: 1 days
when: always
only:
refs:
- /^v[0-9]+(?:.[0-9]+)+(?:[-]rc[0-9]+)$/
- /^v[0-9]+(?:.[0-9]+)+$/
.deploy:
stage: deploy
dependencies:
- build
before_script:
- pip install --upgrade twine
- echo "$PYPIRC" > ~/.pypirc
- chmod 600 ~/.pypirc
deploy:staging:
extends: .deploy
script:
- twine upload --repository comlipy-test dist/*
only:
refs:
- /^v[0-9]+(?:.[0-9]+)+(?:[-]rc[0-9]+)$/
deploy:production:
extends: .deploy
script:
- twine upload --repository comlipy dist/*
only:
refs:
- /^v[0-9]+(?:.[0-9]+)+$/