From 518c37ada834bc740e5001882358ce4e2681539c Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Wed, 29 Apr 2026 15:12:18 +0530 Subject: [PATCH 1/4] chore: pin workflow dependencies Signed-off-by: Keshav Priyadarshi --- .github/workflows/docs-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index dbb8edf8..f1c2fb1a 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -13,12 +13,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ matrix.python-version }} From 3ee0c887e6fee12ec0ae18c1e0cd52842ab2d3fd Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Wed, 29 Apr 2026 15:14:00 +0530 Subject: [PATCH 2/4] chore: release to pypi via trusted publisher Signed-off-by: Keshav Priyadarshi --- .github/workflows/pypi-release.yml | 84 +++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index ffff6a0e..2d603769 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -6,23 +6,69 @@ on: tags: - "v*.*.*" -jobs: - build-and-publish-to-pypi: - name: Build and publish library to PyPI - runs-on: ubuntu-22.04 + build-pypi-distribs: + name: Build for publishing + runs-on: ubuntu-24.04 + permissions: + contents: read + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Python + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: 3.10 + + - name: Install pypa/build + run: python -m pip install build --user + + - name: Build a binary wheel and a source tarball + run: python -m build --sdist --wheel --outdir dist/ + + - name: Upload built archives + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + with: + name: pypi_archives + path: dist/* + + create-gh-release: + name: Create GH release + needs: + - build-pypi-distribs + runs-on: ubuntu-24.04 + + steps: + - name: Download built archives + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + with: + name: pypi_archives + path: dist + + - name: Create GH release + uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 + with: + draft: false + generate_release_notes: true + files: dist/* + + create-pypi-release: + name: Create PyPI release + needs: + - create-gh-release + runs-on: ubuntu-24.04 + environment: pypi-publish + permissions: + id-token: write + steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.9 - - name: Install pypa/build - run: python -m pip install build --user - - name: Build a binary wheel and a source tarball - run: python -m build --sdist --wheel --outdir dist/ - - name: Publish distribution to PyPI - if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} - + - name: Download built archives + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + with: + name: pypi_archives + path: dist + + - name: Publish to PyPI + if: startsWith(github.ref, 'refs/tags/') + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + with: + verbose: true From 05ac0589ada06aee4a6f0b626fd1e4a93022d13e Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Wed, 29 Apr 2026 19:22:48 +0530 Subject: [PATCH 3/4] chore: add workflow to run unit tests Signed-off-by: Keshav Priyadarshi --- .github/workflows/docs-ci.yml | 2 +- .github/workflows/main.yml | 32 ++++++++++++++++++++++++++++++ .github/workflows/pypi-release.yml | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index f1c2fb1a..b35ddb94 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: max-parallel: 4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..799290b4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,32 @@ +name: run tests + +on: [push, pull_request] + + +jobs: + build: + runs-on: ubuntu-24.04 + permissions: + contents: read + + strategy: + max-parallel: 4 + matrix: + python-version: ["3.10", "3.11"] + + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: make dev + + - name: Run tests + run: | + source venv/bin/activate + make test diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 2d603769..9b8599b9 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -6,6 +6,7 @@ on: tags: - "v*.*.*" +jobs: build-pypi-distribs: name: Build for publishing runs-on: ubuntu-24.04 From d889e837e797f60b60291447873a0097a535790a Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Wed, 29 Apr 2026 19:53:26 +0530 Subject: [PATCH 4/4] chore: run unit test on python 3.12 Signed-off-by: Keshav Priyadarshi --- .github/workflows/docs-ci.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index b35ddb94..9f3d6271 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -9,7 +9,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.10",] + python-version: ["3.11",] steps: - name: Checkout code diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 799290b4..bea059ef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12"] steps: - name: Checkout code