Skip to content

Commit 8e9ca78

Browse files
committed
ci: pypi release
1 parent 28a5ce1 commit 8e9ca78

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/release.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release (PyPI)
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
id-token: write
10+
contents: write
11+
12+
jobs:
13+
build-and-release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.12"
25+
26+
- name: Install build tools
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build
30+
31+
- name: Build distributions
32+
run: python -m build
33+
34+
- name: Publish to PyPI (Trusted Publishing)
35+
uses: pypa/gh-action-pypi-publish@release/v1
36+
with:
37+
skip-existing: true
38+
39+
- name: Create GitHub Release
40+
uses: softprops/action-gh-release@v2
41+
with:
42+
tag_name: ${{ github.ref_name }}
43+
name: ${{ github.ref_name }}
44+
generate_release_notes: true
45+
files: dist/*

0 commit comments

Comments
 (0)