Skip to content

Commit ba6fa0a

Browse files
committed
ci(pypi): auto publish on release (OIDC)
1 parent e52623e commit ba6fa0a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
name: publish-pypi
22
on:
33
release:
4-
types: [published]
4+
types: [published] # se dispara cuando semantic-release crea el release
5+
workflow_dispatch: # también manual si lo necesitas
56
permissions:
6-
contents: read
77
id-token: write
8+
contents: read
89
jobs:
9-
publish:
10-
environment: pypi
10+
build-and-publish:
1111
runs-on: ubuntu-latest
12+
environment: pypi
1213
steps:
1314
- uses: actions/checkout@v4
1415
- uses: actions/setup-python@v5
1516
with: { python-version: '3.12' }
16-
- run: python -m pip install -U pip build
17+
- run: python -m pip install --upgrade pip build
1718
- run: python -m build
18-
- uses: pypa/gh-action-pypi-publish@release/v1
19+
- name: Publish to PyPI (OIDC)
20+
uses: pypa/gh-action-pypi-publish@release/v1
21+
with:
22+
skip-existing: true

0 commit comments

Comments
 (0)