-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
93 lines (84 loc) · 2.49 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
image: registry.ritc.jp/ricos/simulation/femio/fistr_ricos:0.3.2py3.9
default:
before_script:
- poetry config virtualenvs.create false
- python3.9 -m pip install vtk==9.2.6
- python3.9 -m pip install mayavi==4.8.1
- poetry build
- python3.9 -m pip install dist/femio-*.whl # Only install root project, not dependencies
# - poetry env use /usr/bin/python3.9
# - pip install --upgrade pip poetry
# - poetry install
stages:
- test
- deploy
autopep8:
stage: test
script:
- python3.9 -m pip install flake8
- python3.9 -m flake8 $(find femio tests -name "*.py")
- python3.9 -m autopep8 --diff --exit-code $(find femio tests -name "*.py")
allow_failure: true
pytest:
stage: test
script:
- python3.9 -m pytest tests
pages:
stage: deploy
script:
- python3.9 -m pip install -r sphinx/requirements.txt
- sphinx-apidoc -f -o ./sphinx femio
- sphinx-build ./sphinx ./docs
- poetry build
- cp -r docs public
- mv dist/*.whl public/
artifacts:
paths:
- docs
- public
only:
- master
- develop
# .deploy:pypi:
# stage: deploy
# script:
# - poetry run pip install --upgrade pip poetry
# - poetry version $VERSION
# - poetry build -f wheel
# - poetry publish --username __token__ --password ${PYPI_ORG_TOKEN} --no-ansi -n -v
# retry: 2
deploy:pypi:master:
stage: deploy
before_script:
- export VERSION=$(grep "^version" pyproject.toml | grep -o "[0-9]\.[0-9]\.[0-9]").dev$(date +"%Y%m%d%H%M")
script:
# - python3.9 -m pip install --upgrade pip poetry
- poetry version $VERSION
- poetry build -f wheel
- poetry publish --username __token__ --password ${PYPI_ORG_TOKEN} --no-ansi -n -v
only:
- master
deploy:pypi:tag:
stage: deploy
before_script:
- export VERSION=$CI_COMMIT_REF_NAME
script:
# - python3.9 -m pip install --upgrade pip poetry
- poetry version $VERSION
- poetry build -f wheel
- poetry publish --username __token__ --password ${PYPI_ORG_TOKEN} --no-ansi -n -v
only:
- tags
deploy:ricos:
stage: deploy
before_script:
- export VERSION=$(grep "^version" pyproject.toml | grep -o "[0-9]\.[0-9]\.[0-9]").dev$(date +"%Y%m%d%H%M")
script:
# - python3.9 -m pip install --upgrade pip poetry
- poetry version $VERSION
- poetry config repositories.ricos https://pypi.ritc.jp
- poetry build -f wheel
- poetry publish --username ricos --password ${RICOS_PYPI_KEY} -r ricos --no-ansi -n -v
only:
- develop
retry: 2