Skip to content

Commit ff505d2

Browse files
Update deploy-pypi.yml
1 parent 582d7ce commit ff505d2

1 file changed

Lines changed: 37 additions & 4 deletions

File tree

.github/workflows/deploy-pypi.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: Deploy to Pypi
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
22

3-
on: workflow_dispatch
3+
on: push
44

55
jobs:
66
build:
@@ -34,10 +34,43 @@ jobs:
3434
Publish Python 🐍 distribution 📦 to PyPI
3535
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
3636
needs:
37-
- build
37+
- build
3838
runs-on: ubuntu-latest
3939
environment:
4040
name: pypi
4141
url: https://pypi.org/p/jsoniq
4242
permissions:
43-
id-token: write
43+
id-token: write # IMPORTANT: mandatory for trusted publishing
44+
45+
steps:
46+
- name: Download all the dists
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
- name: Publish distribution 📦 to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
54+
publish-to-testpypi:
55+
name: Publish Python 🐍 distribution 📦 to TestPyPI
56+
needs:
57+
- build
58+
runs-on: ubuntu-latest
59+
60+
environment:
61+
name: testpypi
62+
url: https://test.pypi.org/p/jsoniq
63+
64+
permissions:
65+
id-token: write # IMPORTANT: mandatory for trusted publishing
66+
67+
steps:
68+
- name: Download all the dists
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: python-package-distributions
72+
path: dist/
73+
- name: Publish distribution 📦 to TestPyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1
75+
with:
76+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)