-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
86 lines (78 loc) · 1.81 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
image: python:3.7-alpine
variables:
PACKAGE_NAME: encoding_tools
stages:
- test
- build
- release
python-3.6:
stage: test
image: python:3.6-alpine
before_script:
- pip install -r requirements.txt
script:
- pytest
except:
- schedules
python-3.7:
stage: test
image: python:3.7-alpine
before_script:
- pip install -r requirements.txt
script:
- pytest
except:
- schedules
build-package:
stage: build
image: python:3.7-alpine
variables:
TWINE_REPOSITORY_URL: $TEST_PYPI_REPO_URL
TWINE_REPOSITORY: $TEST_PYPI_REPO_URL
TWINE_USERNAME: $TEST_PYPI_USERNAME
TWINE_PASSWORD: $TEST_PYPI_PASSWORD
before_script:
- pip install -r requirements.txt
- pip install twine
script:
- python setup.py sdist bdist_wheel
- twine upload dist/*
- pip install $PACKAGE_NAME --index-url https://test.pypi.org/simple/
only:
- tags
except:
- schedules
mirror-to-github:
stage: release
image: debian:stretch-slim
variables:
GIT_SSH_COMMAND: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
before_script:
- apt-get update -y && apt-get install openssh-client git -y
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- ssh-add <(echo "$GITHUB_SSH_KEY")
- git remote add github $GITHUB_REPO_LINK || true
script:
- git push -f github master
- git push -f github master --tags
except:
- schedules
upload-to-pypi:
stage: release
image: python:3.7-alpine
variables:
TWINE_REPOSITORY_URL: $PYPI_REPO_URL
TWINE_REPOSITORY: $PYPI_REPO_URL
TWINE_USERNAME: $PYPI_USERNAME
TWINE_PASSWORD: $PYPI_PASSWORD
before_script:
- pip install -r requirements.txt
- pip install twine
script:
- python setup.py sdist bdist_wheel
- twine upload dist/*
only:
- tags
except:
- schedules