Skip to content

Commit 450d138

Browse files
committed
pypi publish with trusted publisher
1 parent bebfe78 commit 450d138

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
python-version: '3.12'
2525
- uses: pre-commit/action@v3.0.1
2626

27-
test_pipenv:
28-
name: Run tests in development environment with pipenv
27+
test_devenv:
28+
name: Run tests in development environment
2929
runs-on: ubuntu-latest
3030
steps:
3131
- uses: actions/checkout@v6
@@ -110,6 +110,8 @@ jobs:
110110
if: github.event.ref == 'refs/heads/dev'
111111
runs-on: ubuntu-latest
112112
needs: [dist_check]
113+
permissions:
114+
id-token: write
113115
steps:
114116
- uses: actions/download-artifact@v4
115117
with:
@@ -118,30 +120,25 @@ jobs:
118120
- name: Publish distribution to Test PyPI
119121
uses: pypa/gh-action-pypi-publish@v1.13.0
120122
with:
121-
user: __token__
122-
password: ${{ secrets.test_pypi_token }}
123-
repository_url: https://test.pypi.org/legacy/
124-
skip_existing: true
123+
repository-url: https://test.pypi.org/legacy/
124+
skip-existing: true
125125

126126

127127
dist_upload_pypi:
128128
if: startsWith(github.event.ref, 'refs/tags')
129129
runs-on: ubuntu-latest
130130
needs: [dist_check]
131+
permissions:
132+
id-token: write
131133
steps:
132134
- uses: actions/download-artifact@v4
133135
with:
134136
name: dist
135137
path: dist
136138
- name: Publish package to PyPI
137139
uses: pypa/gh-action-pypi-publish@v1.13.0
138-
with:
139-
user: __token__
140-
password: ${{ secrets.pypi_token }}
141140
- name: Publish distribution to Test PyPI
142141
uses: pypa/gh-action-pypi-publish@v1.13.0
143142
with:
144-
user: __token__
145-
password: ${{ secrets.test_pypi_token }}
146-
repository_url: https://test.pypi.org/legacy/
147-
skip_existing: true
143+
repository-url: https://test.pypi.org/legacy/
144+
skip-existing: true

0 commit comments

Comments
 (0)