Skip to content

Commit aae52bd

Browse files
kesmit13claude
andcommitted
Update publish workflow to use PyPI trusted publishing
Replace twine-based PyPI publishing with OIDC-based trusted publishing using the pypa/gh-action-pypi-publish GitHub Action. Changes: - Add permissions block with id-token: write for OIDC - Add environment block referencing the 'publish' environment - Remove twine installation step - Replace twine upload with gh-action-pypi-publish action Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent be7a773 commit aae52bd

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,14 @@ jobs:
156156

157157
runs-on: ubuntu-latest
158158

159-
steps:
160-
- name: Install dependencies
161-
run: |
162-
python -m pip install --upgrade pip
163-
pip install twine==6.0.1
159+
permissions:
160+
id-token: write # Required for OIDC trusted publishing
164161

162+
environment:
163+
name: publish
164+
url: https://pypi.org/p/singlestoredb
165+
166+
steps:
165167
- name: Download Linux wheels and sdist
166168
uses: actions/download-artifact@v4
167169
with:
@@ -180,14 +182,9 @@ jobs:
180182
name: artifacts-macOS
181183
path: dist
182184

183-
- name: Publish PyPI package
185+
- name: Publish to PyPI
184186
if: ${{ github.event_name == 'release' || github.event.inputs.publish_pypi == 'true' }}
185-
env:
186-
TWINE_USERNAME: __token__
187-
TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
188-
run: |
189-
ls ./dist/*
190-
twine upload ./dist/*
187+
uses: pypa/gh-action-pypi-publish@release/v1
191188

192189
# - name: Publish Conda package
193190
# if: ${{ github.event_name == 'release' || github.event.inputs.publish_anaconda == 'true' }}

0 commit comments

Comments
 (0)