-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
74 lines (63 loc) · 1.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
stages:
- build
- release
default:
image: $CI_REGISTRY/$CI_PROJECT_NAMESPACE/pyniryo:latest
cache:
paths:
- .cache/pip
before_script:
- python3 -m venv venv
- source venv/bin/activate
- pip install -r requirements.txt -r docs/requirements.txt
pages:
stage: build
script:
- git fetch --tags --force
- git checkout $CI_COMMIT_REF_NAME
- scripts/build_docs_versioned.py public $CI_COMMIT_REF_NAME $(git tag)
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == "develop"
variables:
GIT_STRATEGY: "clone"
build_package:
stage: build
script:
- python3 -m pip install --upgrade build
- python3 -m build
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"
artifacts:
paths:
- dist
upload_package:
stage: release
script:
- pip install --upgrade twine
- twine upload -u __token__ -p $PYPI_TOKEN --repository-url $PYPI_UPLOAD_URL dist/*
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"
variables:
PYPI_UPLOAD_URL: https://upload.pypi.org/legacy/
mirror_github:
stage: release
dependencies: [ ]
variables:
GIT_STRATEGY: none
GITHUB_REPOSITORY: [email protected]:NiryoRobotics/pyniryo2.git
before_script: []
script:
- eval $(ssh-agent)
- chmod 600 $GITHUB_SSH_KEY
- ssh-add $GITHUB_SSH_KEY
- mkdir -p ~/.ssh
- ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
- git clone --bare $CI_REPOSITORY_URL
- cd $CI_PROJECT_NAME.git
- git push $GITHUB_REPOSITORY master --tags -f
cache: []
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"