From 7e7e1998c415b20d73d2e036f5727b3030addad1 Mon Sep 17 00:00:00 2001 From: Cybertech <131432994+cybertechsoft@users.noreply.github.com> Date: Sun, 20 Sep 2026 00:14:57 +0530 Subject: [PATCH] Add PyPI trusted publishing workflow --- .github/workflows/release.yml | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 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..0f575e5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Publish to PyPI + +on: + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + name: Build distributions + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v7 + + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: "3.12" + + - name: Install build tooling + run: python -m pip install --upgrade pip build + + - name: Build package + run: python -m build + + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish: + name: Publish to PyPI + needs: build + runs-on: ubuntu-latest + + environment: + name: pypi + + permissions: + id-token: write + + steps: + - name: Download distributions + uses: actions/download-artifact@v5 + with: + name: python-package-distributions + path: dist/ + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1