Skip to content

Commit 3aa188d

Browse files
committed
updated pypi-publish ci
1 parent a659776 commit 3aa188d

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

.github/workflows/test_n_pub.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Run tests
6363
run: pytest -vv
6464

65-
distribute:
65+
release:
6666
name: Distribution
6767
runs-on: ubuntu-latest
6868
needs: tests
@@ -89,15 +89,26 @@ jobs:
8989
files: dist/*
9090
env:
9191
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92-
93-
# - name: Publish distribution 📦 to Test PyPI
94-
# uses: pypa/gh-action-pypi-publish@master
95-
# with:
96-
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
97-
# repository_url: https://test.pypi.org/legacy/
98-
# skip_existing: true
99-
100-
- name: Publish distribution 📦 to PyPI
101-
uses: pypa/gh-action-pypi-publish@release/v1
92+
93+
- uses: actions/upload-artifact@v4
10294
with:
103-
password: ${{ secrets.PYPI_API_TOKEN }}
95+
path: ./dist
96+
97+
pypi-publish:
98+
name: Upload release to PyPI
99+
needs: release
100+
runs-on: ubuntu-latest
101+
# environment:
102+
# name: pypi
103+
# url: https://pypi.org/p/<your-pypi-project-name>
104+
permissions:
105+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
106+
steps:
107+
# retrieve your distributions to artifact folder
108+
- uses: actions/download-artifact@v4
109+
110+
- name: Publish package distributions to PyPI
111+
uses: pypa/gh-action-pypi-publish@release/v1
112+
with:
113+
packages-dir: artifact/
114+
skip-existing: true

0 commit comments

Comments
 (0)