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..08cdde0a --- /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 --sdist + - 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 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