Skip to content

Commit ec6280c

Browse files
authored
add publish workflow
0 parents  commit ec6280c

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
name: Publish Python Package
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
release-build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: astral-sh/setup-uv@v6
19+
20+
- name: Build release distributions
21+
run: |
22+
uv build
23+
24+
- name: Upload distributions
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: release-dists
28+
path: dist/
29+
30+
pypi-publish:
31+
runs-on: ubuntu-latest
32+
needs:
33+
- release-build
34+
permissions:
35+
# IMPORTANT: this permission is mandatory for trusted publishing
36+
id-token: write
37+
38+
# Dedicated environments with protections for publishing are strongly recommended.
39+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
40+
environment:
41+
name: pypi
42+
url: https://pypi.org/p/runtime-docs
43+
44+
steps:
45+
- name: Retrieve release distributions
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: release-dists
49+
path: dist/
50+
51+
- name: Publish release distributions to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
with:
54+
packages-dir: dist/

0 commit comments

Comments
 (0)