Skip to content

Commit 5c288d1

Browse files
ci: add PyPI trusted publishing release workflow (#7)
1 parent 8b1b561 commit 5c288d1

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
name: Build package
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: astral-sh/setup-uv@v5
15+
with:
16+
enable-cache: true
17+
- name: Build sdist and wheel
18+
run: uv build
19+
- name: Store distributions
20+
uses: actions/upload-artifact@v4
21+
with:
22+
name: python-package-distributions
23+
path: dist/
24+
25+
publish-pypi:
26+
name: Publish to PyPI
27+
needs: [build]
28+
runs-on: ubuntu-latest
29+
environment:
30+
name: pypi
31+
url: https://pypi.org/p/quantbench
32+
permissions:
33+
id-token: write
34+
steps:
35+
- name: Download distributions
36+
uses: actions/download-artifact@v4
37+
with:
38+
name: python-package-distributions
39+
path: dist/
40+
- name: Publish to PyPI
41+
uses: pypa/gh-action-pypi-publish@release/v1
42+
with:
43+
skip-existing: true

0 commit comments

Comments
 (0)