-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
93 lines (79 loc) · 2.01 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
stages:
- build
- release
default:
image: $CI_REGISTRY_IMAGE:latest
cache:
paths:
- .cache/pip
before_script:
- python3 -m venv venv
- source venv/bin/activate
- pip install -r requirements.txt -r docs/requirements.txt
build_docker:
stage: .pre
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [ "" ]
# override default before_script
before_script: []
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/.docker/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:latest"
only:
changes:
- .docker/Dockerfile
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"
when: manual
variables:
PYPI_UPLOAD_URL: https://upload.pypi.org/legacy/
id_tokens:
PYPI_TOKEN:
aud: https://pypi.org/project/pyniryo/
mirror_github:
stage: release
dependencies: [ ]
variables:
GIT_STRATEGY: clone
GITHUB_REPOSITORY: [email protected]:NiryoRobotics/pyniryo.git
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 remote add github $GITHUB_REPOSITORY
- git push -f --tags github
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"