From 9fe750a6a1ba40901cfbb00eeada1b898148e1f4 Mon Sep 17 00:00:00 2001 From: Prajwal7-2002 Date: Tue, 27 Oct 2026 00:37:41 +0530 Subject: [PATCH] ci: add PyPI trusted publishing release workflow --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6a73046 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +on: + push: + tags: + - "v*" + +jobs: + build: + name: Build package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + - name: Build sdist and wheel + run: uv build + - name: Store distributions + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-pypi: + name: Publish to PyPI + needs: [build] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/quantbench + permissions: + id-token: write + steps: + - name: Download distributions + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true