Update workflow to trigger on published releases (#2508)

This commit is contained in:
Soxoj
2026-04-10 12:34:00 +02:00
committed by GitHub
parent 385f9f5bb3
commit 7fd9bb3692
+23 -14
View File
@@ -1,21 +1,30 @@
name: Upload Python Package to PyPI when a Release is Created name: Upload Python Package to PyPI when a Release is Published
on: on:
release: release:
types: [created] types: [published]
push:
tags:
- "v*"
permissions:
id-token: write
contents: read
jobs: jobs:
build-and-publish: pypi-publish:
name: Publish release to PyPI
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/maigret
permissions:
id-token: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3 - name: Set up Python
- run: uv build uses: actions/setup-python@v4
- name: Publish to PyPI (Trusted Publishing)
uses: pypa/gh-action-pypi-publish@release/v1
with: with:
packages-dir: dist python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1