@@ -19,15 +19,12 @@ concurrency:
19
19
20
20
jobs :
21
21
22
-
23
22
style :
24
23
name : Code style
25
24
runs-on : ubuntu-latest
26
25
steps :
27
- - uses : actions/checkout@v3
28
-
29
- - name : Set up Python
30
- uses : actions/setup-python@v4
26
+ - name : PyAnsys code style checks
27
+ uses : pyansys/actions/code-style@v1
31
28
with :
32
29
python-version : ${{ env.MAIN_PYTHON_VERSION }}
33
30
@@ -41,24 +38,26 @@ jobs:
41
38
name : Documentation Style Check
42
39
runs-on : ubuntu-latest
43
40
steps :
44
- - uses : actions/checkout@v3
41
+ - name : PyAnsys documentation style checks
42
+ uses : pyansys/actions/doc-style@v1
43
+ with :
44
+ token : ${{ secrets.GITHUB_TOKEN }}
45
45
46
- - name : Running Vale
47
- uses : errata-ai/vale-action@reviewdog
48
- env :
49
- GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
46
+ docs-build :
47
+
48
+ name : Doc building
49
+ runs-on : ubuntu-latest
50
+ needs : docs-style
51
+ steps :
52
+ - name : " Run Ansys documentation building action"
53
+ uses : pyansys/actions/doc-build@v1
50
54
with :
51
- files : doc
52
- reporter : github-pr-check
53
- level : error
54
- filter_mode : nofilter
55
- fail_on_error : true
56
- vale_flags : " --config=doc/.vale.ini"
55
+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
57
56
58
57
tests :
59
58
name : Build and testing
60
59
runs-on : ubuntu-latest
61
- needs : [style,docs]
60
+ needs : [style,docs-build ]
62
61
63
62
steps :
64
63
- uses : actions/checkout@v3
@@ -105,99 +104,28 @@ jobs:
105
104
path : dist/
106
105
retention-days : 7
107
106
108
- docs :
109
- name : Documentation
110
- runs-on : ubuntu-latest
111
- needs : [docs-style]
112
-
113
- steps :
114
- - uses : actions/checkout@v3
115
-
116
- - name : Set up Python
117
- uses : actions/setup-python@v4
118
- with :
119
- python-version : ${{ env.MAIN_PYTHON_VERSION }}
120
-
121
- - name : Install OS packages
122
- run : |
123
- sudo apt update
124
- sudo apt install zip pandoc libgl1-mesa-glx xvfb texlive-latex-extra latexmk
125
-
126
- - name : Install library
127
- run : pip install .
128
-
129
- - name : Build HTML
130
- run : |
131
- pip install .[doc]
132
- make -C doc html SPHINXOPTS="-W"
133
-
134
- - name : Generate the PDF documentation
135
- run : |
136
- make -C doc pdf
137
-
138
- - name : Upload HTML documentation
139
- uses : actions/upload-artifact@v3
140
- with :
141
- name : HTML-Documentation
142
- path : doc/build/html
143
- retention-days : 7
144
-
145
- - name : Upload PDF Documentation
146
- uses : actions/upload-artifact@v3
147
- with :
148
- name : Documentation-pdf
149
- path : doc/build/latex/*.pdf
150
- retention-days : 7
107
+ release :
151
108
152
- Release :
153
- if : contains(github.ref, 'refs/tags')
154
- needs : [tests, style, docs ]
109
+ name : " Release project to private PyPI, public PyPI and GitHub "
110
+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
111
+ needs : [tests]
155
112
runs-on : ubuntu-latest
156
113
steps :
157
- - name : Set up Python
158
- uses : actions/setup-python@v4
159
- with :
160
- python-version : 3.9
161
-
162
- - uses : actions/checkout@v3
163
-
164
- - uses : actions/download-artifact@v3
165
- with :
166
- name : ansys-pyoptics-wheel
167
-
168
- - uses : actions/download-artifact@v3
169
- with :
170
- name : Documentation-pdf
171
-
172
- - uses : actions/download-artifact@v3
173
- with :
174
- name : Documentation-html
175
- path : ~/html
176
-
177
- # list current directory
178
- - name : List directory structure
179
- run : ls -R
180
-
181
- - name : Deploy
182
-
183
- with :
184
- BRANCH : gh-pages
185
- FOLDER : ~/html
186
- CLEAN : true
187
-
188
- # note how we use the PyPI tokens
189
- - name : Upload to Azure PyPi (disabled)
190
- run : |
191
- pip install twine
192
- # twine upload --skip-existing ./**/*.whl
193
- env :
194
- TWINE_USERNAME : __token__
195
- TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
196
-
197
- - name : Release
198
- uses : softprops/action-gh-release@v1
199
- with :
200
- files : |
201
- ./**/*.whl
202
- ./**/*.zip
203
- ./**/*.pdf
114
+ # - name: "Release to the private PyPI repository"
115
+ # uses: pyansys/actions/release-pypi-private@v1
116
+ # with:
117
+ # library-name: ${{ env.PACKAGE_NAME }}
118
+ # twine-username: "__token__"
119
+ # twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
120
+ #
121
+ # - name: "Release to the public PyPI repository"
122
+ # uses: pyansys/actions/release-pypi-public@v1
123
+ # with:
124
+ # library-name: ${{ env.PACKAGE_NAME }}
125
+ # twine-username: "__token__"
126
+ # twine-token: ${{ secrets.PYPI_TOKEN }}
127
+ #
128
+ - name : " Release to GitHub"
129
+ uses : pyansys/actions/release-github@v1
130
+ with :
131
+ library-name : ${{ env.PACKAGE_NAME }}
0 commit comments