From 18fcf2e192953c74dc4ed45355d84e4c0896817f Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Wed, 2 Jul 2025 13:17:32 +0200 Subject: [PATCH 1/3] Update publishing workflow --- .github/workflows/pythonpublish.yml | 34 ------------------------ .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/pythonpublish.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml deleted file mode 100644 index 66e7be4e..00000000 --- a/.github/workflows/pythonpublish.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Upload Python Package - -on: - push: - tags: - - v* - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: '3.x' - - name: Install dependencies - uses: BSFishy/pip-action@v1 - with: - packages: | - setuptools - wheel - twine - cython - packaging - numpy - pkgconfig - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: | - python setup.py sdist - twine upload dist/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..49624796 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: Upload Python Package + +on: + push: + tags: + - v* + +jobs: + build: + name: Build package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - run: pip install --upgrade build + - name: Build package + run: pyproject-build + - uses: actions/upload-artifact@v4 + with: + name: dist + path: dist + overwrite: true + if-no-files-found: error + retention-days: 1 + + publish: + name: Upload release to PyPI + needs: build + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Download package + uses: actions/download-artifact@v4 + with: + name: dist + path: dist + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file From 304224ced3885bcabb3a6897f1442ae09f429aa2 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Fri, 4 Jul 2025 07:46:13 +0200 Subject: [PATCH 2/3] Add CHANGELOG entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 785df480..cfefbf93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## latest + +* Renaming and using a newer workflow for publishing according to the trusted publishing in PyPI https://github.com/precice/python-bindings/pull/241 + ## 3.2.1 * Modify docstrings to highlight flexibility of the API in terms of its ability to handle multidimensional input data structures https://github.com/precice/python-bindings/pull/239 From 4912e274cf1f4c4f6b015c34d46b213c2b106836 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Fri, 4 Jul 2025 10:33:43 +0200 Subject: [PATCH 3/3] Build the bindings from source to create the distribution archive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Frédéric Simonis --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 49624796..08cdde0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: python-version: '3.x' - run: pip install --upgrade build - name: Build package - run: pyproject-build + run: pyproject-build --sdist - uses: actions/upload-artifact@v4 with: name: dist