forked from scanny/python-pptx
-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (51 loc) · 1.5 KB
/
Copy pathpublish.yml
File metadata and controls
55 lines (51 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: publish
# Builds and publishes python-pptx-extended to PyPI using PyPI Trusted
# Publishing (OIDC). No long-lived API token is stored in repo secrets — the
# workflow's identity is verified by PyPI against the configured Trusted
# Publisher (see one-time setup in the PR description).
#
# Triggers:
# - GitHub Release published (recommended path: cut a release in the GH UI)
# - Manual workflow_dispatch (override / re-run)
#
# Tag pushes alone do not trigger this; create a Release pointing at the tag.
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
name: Build sdist and wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Build distributions
run: uv build
- name: Verify metadata renders
run: uv tool run --from twine twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
publish-pypi:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/python-pptx-extended/
permissions:
id-token: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1