-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (27 loc) · 985 Bytes
/
Copy pathpython-publish.yml
File metadata and controls
32 lines (27 loc) · 985 Bytes
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
# Publish the built Python package to PyPI when a GitHub Release is published.
# For more information, see https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
name: Upload Python Package
on:
release:
types: [published]
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: pdm-project/setup-pdm@v4
- name: Build package
run: pdm build
- name: Publish package with Trusted Publishing
uses: pypa/gh-action-pypi-publish@release/v1