1212env :
1313 PACKAGE_NAME : ansys-tools-common
1414 MAIN_PYTHON_VERSION : 3.13
15- DOCUMENTATION_CNAME : bookish-adventure-16g5prl.pages.github.io
15+ DOCUMENTATION_CNAME : tools.docs.pyansys.com
1616
1717jobs :
18+
19+ update-changelog :
20+ name : " Update CHANGELOG (on release)"
21+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
22+ runs-on : ubuntu-latest
23+ permissions :
24+ contents : write
25+ pull-requests : write
26+ steps :
27+ - uses : ansys/actions/doc-deploy-changelog@v10
28+ with :
29+ token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
30+ bot-user : ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
31+ bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
32+
33+ # TODO uncomment after the first public release
34+ # check-vulnerabilities:
35+ # name: "Check library vulnerabilities"
36+ # runs-on: ubuntu-latest
37+ # steps:
38+ # - uses: ansys/actions/[email protected] 39+ # with:
40+ # python-version: ${{ env.MAIN_PYTHON_VERSION }}
41+ # token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
42+ # python-package-name: ${{ env.PACKAGE_NAME }}
43+ # dev-mode: ${{ github.ref != 'refs/heads/main' }}
44+
1845 style :
1946 name : Code style
2047 runs-on : ubuntu-latest
4067 python-version : ${{ matrix.python-version }}
4168 whitelist-license-check : " termcolor" # Has MIT license, but it's not recognized
4269
43- build- tests :
44- name : Build and Testing
70+ tests :
71+ name : Testing
4572 runs-on : ubuntu-latest
4673 needs : [smoke-tests]
4774 env :
@@ -75,8 +102,18 @@ jobs:
75102 # with:
76103 # token: ${{ secrets.CODECOV_TOKEN }}
77104
105+ docs-style :
106+ name : Documentation Style Check
107+ runs-on : ubuntu-latest
108+ steps :
109+ - name : PyAnsys documentation style checks
110+ uses : ansys/actions/doc-style@v10
111+ with :
112+ token : ${{ secrets.GITHUB_TOKEN }}
113+
78114 doc-build :
79115 name : Build documentation
116+ needs : [docs-style]
80117 runs-on : ubuntu-latest
81118 steps :
82119 - name : Build documentation
@@ -88,24 +125,62 @@ jobs:
88125 package :
89126 name : Package library
90127 runs-on : ubuntu-latest
91- needs : [smoke- tests]
128+ needs : [tests, doc-build ]
92129 steps :
93130 - name : Build library source and wheel artifacts
94131 uses : ansys/actions/build-library@v10
95132 with :
96133 library-name : ${{ env.PACKAGE_NAME }}
97134 python-version : ${{ env.MAIN_PYTHON_VERSION }}
98135
99- upload_dev_docs :
100- name : Upload dev documentation
101- if : github.ref == 'refs/heads/main'
136+ release :
137+ name : Release project
138+ if : ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
139+ needs : [package]
102140 runs-on : ubuntu-latest
103- needs : [doc-build]
141+ environment : release
142+ permissions :
143+ id-token : write
144+ contents : write
104145 steps :
105- - name : Deploy the latest documentation
106- uses : ansys/actions/doc-deploy-dev@v10
146+ - name : " Download the library artifacts from build-library step"
147+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
148+ with :
149+ name : ${{ env.PACKAGE_NAME }}-artifacts
150+ path : ${{ env.PACKAGE_NAME }}-artifacts
151+
152+ # TODO uncomment after the first public release
153+ # - name: "Upload artifacts to PyPI using trusted publisher"
154+ # uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
155+ # with:
156+ # repository-url: "https://upload.pypi.org/legacy/"
157+ # print-hash: true
158+ # packages-dir: ${{ env.PACKAGE_NAME }}-artifacts
159+ # skip-existing: false
160+
161+ - name : " Release to the private PyPI repository"
162+ uses : ansys/actions/release-pypi-private@v9
163+ with :
164+ library-name : " ansys-api-meshing-maestro"
165+ twine-username : " __token__"
166+ twine-token : ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
167+
168+ - name : Release to GitHub
169+ uses : ansys/actions/release-github@v10
170+ with :
171+ token : ${{ secrets.GITHUB_TOKEN }}
172+ library-name : ${{ env.PACKAGE_NAME }}
173+
174+ upload_docs_release :
175+ name : Upload release documentation
176+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
177+ runs-on : ubuntu-latest
178+ needs : [release]
179+ steps :
180+ - name : Deploy the stable documentation
181+ uses : ansys/actions/doc-deploy-stable@v10
107182 with :
108183 cname : ${{ env.DOCUMENTATION_CNAME }}
109184 token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
110185 bot-user : ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
111- bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
186+ bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
0 commit comments