From 03dd23e137a4228a95b0fbe62687cd55b0e11e8f Mon Sep 17 00:00:00 2001 From: Alonso David De Leon Rodarte Date: Mon, 29 Jun 2026 23:32:49 -0600 Subject: [PATCH] ci: add PyPI publish workflow (Trusted Publishing on release) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Publishes to PyPI via OIDC when a GitHub Release is published — no API token. Also ignores build/ and dist/ artifacts. --- .github/workflows/publish.yml | 22 ++++++++++++++++++++++ .gitignore | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..5e7a6f4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,22 @@ +name: Publish to PyPI + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + id-token: write # required for PyPI Trusted Publishing (OIDC) + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Build + run: | + pip install build + python -m build + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index 1d30504..d539326 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ __pycache__/ *.egg-info/ .venv/ venv/ +build/ +dist/ # Test / coverage .coverage