Skip to content

Commit 948fc3a

Browse files
maint: Complete CICD
1 parent 8fbfac5 commit 948fc3a

File tree

2 files changed

+73
-8
lines changed

2 files changed

+73
-8
lines changed

.github/workflows/cicd.yml

Lines changed: 73 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,44 @@ on:
1212
env:
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

1717
jobs:
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+
vulnerabilities:
34+
name: Vulnerabilities
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: PyAnsys Vulnerability check (on main)
38+
if: github.ref == 'refs/heads/main'
39+
uses: ansys/actions/check-vulnerabilities@v10
40+
with:
41+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
42+
python-package-name: ${{ env.PACKAGE_NAME }}
43+
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
44+
45+
- name: PyAnsys Vulnerability check (on dev mode)
46+
if: github.ref != 'refs/heads/main'
47+
uses: ansys/actions/check-vulnerabilities@v10
48+
with:
49+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
50+
python-package-name: ${{ env.PACKAGE_NAME }}
51+
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
52+
dev-mode: true
1853
style:
1954
name: Code style
2055
runs-on: ubuntu-latest
@@ -96,16 +131,46 @@ jobs:
96131
library-name: ${{ env.PACKAGE_NAME }}
97132
python-version: ${{ env.MAIN_PYTHON_VERSION }}
98133

99-
upload_dev_docs:
100-
name: Upload dev documentation
101-
if: github.ref == 'refs/heads/main'
134+
release:
135+
name: Release project
136+
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
137+
needs: [package]
102138
runs-on: ubuntu-latest
103-
needs: [doc-build]
139+
environment: release
140+
permissions:
141+
id-token: write
142+
contents: write
104143
steps:
105-
- name: Deploy the latest documentation
106-
uses: ansys/actions/doc-deploy-dev@v10
144+
- name: "Download the library artifacts from build-library step"
145+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
146+
with:
147+
name: ${{ env.PACKAGE_NAME }}-artifacts
148+
path: ${{ env.PACKAGE_NAME }}-artifacts
149+
150+
- name: "Upload artifacts to PyPI using trusted publisher"
151+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
152+
with:
153+
repository-url: "https://upload.pypi.org/legacy/"
154+
print-hash: true
155+
packages-dir: ${{ env.PACKAGE_NAME }}-artifacts
156+
skip-existing: false
157+
158+
- name: Release to GitHub
159+
uses: ansys/actions/release-github@v10
160+
with:
161+
token: ${{ secrets.GITHUB_TOKEN }}
162+
library-name: ${{ env.PACKAGE_NAME }}
163+
164+
upload_docs_release:
165+
name: Upload release documentation
166+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
167+
runs-on: ubuntu-latest
168+
needs: [release]
169+
steps:
170+
- name: Deploy the stable documentation
171+
uses: ansys/actions/doc-deploy-stable@v10
107172
with:
108173
cname: ${{ env.DOCUMENTATION_CNAME }}
109174
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
110175
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
111-
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
176+
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}

CHANGELOG.md

Whitespace-only changes.

0 commit comments

Comments
 (0)