From 4800cd8f1a1cdfb75d586ed29a2ba4f298b7f88a Mon Sep 17 00:00:00 2001 From: danielward27 Date: Tue, 6 May 2025 16:34:46 +0100 Subject: [PATCH] Update workflow (try to fix publishing) --- .github/workflows/publish.yml | 44 +++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 39f3aa6..a93725f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Publish to TestPyPI and PyPI +name: Publish to PyPI on: # Triggers the workflow when a release is created or edited. @@ -6,30 +6,44 @@ on: types: [created] jobs: - build-n-publish: - name: Publish to TestPyPI and PyPI + build: + name: Build distribution runs-on: ubuntu-latest - permissions: - id-token: write # For pypi trusted publishing - steps: - uses: actions/checkout@v4 - - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install pypa/build - run: python -m pip install build --user - + run: python3 -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 Test PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 with: - repository-url: https://test.pypi.org/legacy/ + name: python-package-distributions + path: dist/ - - name: Publish distribution to PyPI + publish-to-pypi: + name: Publish to PyPI + needs: + - build + runs-on: ubuntu-latest + + environment: + name: pypi + url: https://pypi.org/p/paramax + + permissions: + id-token: write # Mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1