From 3a70030301ce4ebde5d531e346096095f461750d Mon Sep 17 00:00:00 2001 From: thomaszwagerman Date: Wed, 1 Apr 2026 14:18:24 +0100 Subject: [PATCH 1/4] add pypi.yml --- .github/workflows/pypi.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 00000000..e69de29b From 5fe89718b15f7956e58254f4c19002c2f42c6d00 Mon Sep 17 00:00:00 2001 From: thomaszwagerman Date: Wed, 1 Apr 2026 14:43:33 +0100 Subject: [PATCH 2/4] actually replace polaroute with meshiphi name --- .github/workflows/pypi.yml | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index e69de29b..eed5f9f2 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -0,0 +1,53 @@ +name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI + +on: push + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.x" + + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v5 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/meshiphi # Replace with your PyPI project name + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v6 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From 26ee3fa2ab4b7827458f3be1378313ef49a983dd Mon Sep 17 00:00:00 2001 From: thomaszwagerman Date: Wed, 1 Apr 2026 16:24:42 +0100 Subject: [PATCH 3/4] update tag regex --- .github/workflows/pypi.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index eed5f9f2..2d516f49 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -33,7 +33,9 @@ jobs: publish-to-pypi: name: >- Publish Python 🐍 distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + if: | + startsWith(github.ref, 'refs/tags/') && + matches(github.ref, '^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$') # Only run on tags that match the pattern v*.*.* needs: - build runs-on: ubuntu-latest From 4875c63bd94af3ef50d488b5d367b663a156aaef Mon Sep 17 00:00:00 2001 From: thomaszwagerman Date: Wed, 1 Apr 2026 16:30:07 +0100 Subject: [PATCH 4/4] remove use of matches(), move regex logic to top but project with if startsWith under publish-to-pypi --- .github/workflows/pypi.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 2d516f49..4be98cdc 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,6 +1,10 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI -on: push +on: + push: + branches: ['**'] # Build on all branch pushes + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' # Only trigger on semantic version tags like v1.2.3 jobs: build: @@ -33,9 +37,7 @@ jobs: publish-to-pypi: name: >- Publish Python 🐍 distribution 📦 to PyPI - if: | - startsWith(github.ref, 'refs/tags/') && - matches(github.ref, '^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$') # Only run on tags that match the pattern v*.*.* + if: startsWith(github.ref, 'refs/tags/v') # Only publish on version tags needs: - build runs-on: ubuntu-latest