From 7a5b3df90b76e8a699cdb40d9ab335617c85f383 Mon Sep 17 00:00:00 2001 From: SaribAzim Date: Wed, 19 Aug 2026 21:35:38 +0500 Subject: [PATCH 1/2] chore: add PyPI publishing workflow --- .github/workflows/publish.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 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..f66a527 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +name: Publish to PyPI + +on: + push: + branches: + - main + +permissions: + contents: read + id-token: write + +jobs: + publish: + runs-on: ubuntu-latest + + environment: + name: pypi + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install build tools + run: | + python -m pip install --upgrade pip + pip install build + + - name: Build package + run: python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file From 7bb457d72f762b655c1309939a1b898f4a9bec16 Mon Sep 17 00:00:00 2001 From: SaribAzim Date: Wed, 19 Aug 2026 21:39:11 +0500 Subject: [PATCH 2/2] Slight tweaks in the workflow --- .github/workflows/publish.yml | 42 ++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f66a527..edd4a16 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,16 +5,13 @@ on: branches: - main -permissions: - contents: read - id-token: write - jobs: - publish: + build: + name: Build package runs-on: ubuntu-latest - environment: - name: pypi + permissions: + contents: read steps: - name: Checkout @@ -25,13 +22,36 @@ jobs: with: python-version: "3.x" - - name: Install build tools - run: | - python -m pip install --upgrade pip - pip install build + - name: Install build + run: python -m pip install build - name: Build package run: python -m build + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: python-package + path: dist/ + + publish: + name: Publish to PyPI + runs-on: ubuntu-latest + + needs: build + + environment: + name: pypi + + permissions: + id-token: write + + steps: + - name: Download distributions + uses: actions/download-artifact@v4 + with: + name: python-package + path: dist/ + - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file