Skip to content

Commit ddcce15

Browse files
authored
Add pypi deploy to GH action (#1756)
1 parent 9d06ac6 commit ddcce15

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/python-package-tests.yml renamed to .github/workflows/python-package-tests-and-deploy.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: Python Package Tests
1+
name: Python Package Tests and Deploy
22

33
on:
44
push:
55
branches: [ master ]
66
pull_request:
77
branches: [ master ]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
811

912
jobs:
1013
build-wheel:
@@ -36,6 +39,19 @@ jobs:
3639
with:
3740
name: gridtools-cpp-wheel
3841
path: .python_package/.nox/.cache/dist/gridtools_cpp-*.whl
42+
- name: Publish distribution to Test PyPI
43+
if: ${{ github.event_name == 'release' }}
44+
uses: pypa/gh-action-pypi-publish@release/v1
45+
with:
46+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
47+
repository_url: https://test.pypi.org/legacy/
48+
packages-dir: .python_package/.nox/.cache/dist
49+
- name: Publish distribution to PyPI
50+
if: ${{ github.event_name == 'workflow_dispatch' }}
51+
uses: pypa/gh-action-pypi-publish@release/v1
52+
with:
53+
password: ${{ secrets.PYPI_API_TOKEN }}
54+
packages-dir: .python_package/.nox/.cache/dist
3955

4056
test-wheel:
4157
needs: build-wheel

0 commit comments

Comments
 (0)