forked from atopile/atopile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
95 lines (85 loc) · 1.96 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
stages:
- test
- build
- deploy
docs-build:
stage: build
image:
name: python:latest
script:
- pip install -e.[docs]
- python docs/package_fetcher.py
- mkdocs build --site-dir build/docs/public
artifacts:
paths:
- build/docs/public
docs-deploy:
stage: deploy
image: alpine
needs: ["docs-build"]
before_script:
- apk add openssh-client
- eval $(ssh-agent -s)
- echo "$WWW_SSH_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
script:
- scp -o StrictHostKeyChecking=no -r build/docs/public [email protected]:/var/www/docs
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
docker-build:
stage: build
parallel:
matrix:
- DOCKERFILE:
- ci
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/dockerfiles/Dockerfile.${DOCKERFILE}"
--destination "${CI_REGISTRY_IMAGE}/${DOCKERFILE}:latest"
--destination "${CI_REGISTRY_IMAGE}/${DOCKERFILE}:$CI_COMMIT_TAG"
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION="$CI_COMMIT_TAG"
rules:
- if: $CI_COMMIT_TAG
cli-lint:
stage: test
image: python:latest
script:
- pip install -e ."[dev,test,docs]"
- ruff src/atopile
cli-test:
stage: test
image: python:latest
script:
- pip install -e ."[dev,test,docs]"
- pytest
artifacts:
paths:
- artifacts
cli-deploy:
stage: deploy
image: python:latest
script:
- pip install build twine
- python -m build
- python -m twine upload dist/* -u __token__ -p "${PYPI_TOKEN}"
rules:
- if: $CI_COMMIT_TAG
extension-build:
stage: deploy
image: node:latest
script:
- npm install -g @vscode/vsce
- cd src/vscode-atopile
- vsce package --pre-release
artifacts:
paths:
- src/vscode-atopile/atopile-*.vsix
rules:
- changes:
paths:
- src/vscode-atopile/*