mirror of
https://github.com/soxoj/maigret.git
synced 2026-05-06 22:19:01 +00:00
Update workflow to trigger on published releases (#2508)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user