Skip to content

Commit f22a272

Browse files
authored
fix: ci actions (#10)
This pull-request ensures that the actions are up to date and successfully deploy generated artifacts to the public PyPI.
2 parents 5030f75 + d743304 commit f22a272

File tree

2 files changed

+37
-11
lines changed

2 files changed

+37
-11
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
commit-message:
8+
prefix: "maint"
9+
groups:
10+
actions:
11+
patterns:
12+
- "*"

.github/workflows/ci_cd.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111

1212
env:
1313
LIBRARY_NAME: 'ansys-pythonnet'
14+
MAIN_PYTHON_VERSION: '3.11'
1415

1516
concurrency:
1617
group: ${{ github.workflow }}-${{ github.ref }}
@@ -142,7 +143,7 @@ jobs:
142143
runs-on: ubuntu-latest
143144
needs: [doc-build, tests]
144145
steps:
145-
- uses: pyansys/actions/build-library@v2
146+
- uses: ansys/actions/build-library@v4
146147
with:
147148
library-name: ${{ env.LIBRARY_NAME }}
148149

@@ -153,16 +154,29 @@ jobs:
153154
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
154155
steps:
155156

156-
- name: "Release to the private PyPI repository"
157-
uses: pyansys/actions/release-pypi-private@v2
157+
- name: "Checkout project"
158+
uses: actions/checkout@v4
159+
160+
- name: "Install Python ${{ env.MAIN_PYTHON_VERSION }}"
161+
uses: actions/setup-python@v4
158162
with:
159-
library-name: ${{ env.LIBRARY_NAME }}
160-
twine-username: "__token__"
161-
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
163+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
162164

163-
- name: "Release to the public PyPI repository"
164-
uses: pyansys/actions/release-pypi-public@v2
165+
- name: "Install Python requirements"
166+
run: |
167+
python -m pip install twine
168+
169+
- name: "Download the library artifacts from build-library step"
170+
uses: actions/download-artifact@v3
165171
with:
166-
library-name: ${{ env.LIBRARY_NAME }}
167-
twine-username: "__token__"
168-
twine-token: ${{ secrets.PYPI_TOKEN }}
172+
name: ${{ env.LIBRARY_NAME }}-artifacts
173+
path: ${{ env.LIBRARY_NAME }}-artifacts
174+
175+
- name: "Release to the public PyPI repository"
176+
run: |
177+
python -m twine upload --verbose --skip-existing ${{ env.LIBRARY_NAME }}-artifacts/*.whl
178+
python -m twine upload --verbose --skip-existing ${{ env.LIBRARY_NAME }}-artifacts/*.tar.gz
179+
env:
180+
TWINE_USERNAME: '__token__'
181+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
182+
TWINE_REPOSITORY_URL: 'https://upload.pypi.org/legacy/'

0 commit comments

Comments
 (0)