Skip to content

Commit

Permalink
pypi trusted publishing (#314)
Browse files Browse the repository at this point in the history
* Update version number.

* Fix

* Correct tag ref

* Use BaseArgument.__eq__ in Argument (#147)

(cherry picked from commit e683148)

* Oops! Bump version number.

* Fix.

* Bump version.

* Updated to .md README (#275)

* Kebab case in build-wheels.yml (#276)

* Fixes for pypa packaging.

* Correct documentation links (#277)

* Remove unecessary pip pinning (#278)

* Bump version.

* Update version to 2024.2.0

* Try trusted publishing on pypi.

* Remove version change.

* Fix.

* Tidy.

---------

Co-authored-by: Chris Richardson <[email protected]>
Co-authored-by: Michal Habera <[email protected]>
Co-authored-by: Garth N. Wells <[email protected]>
  • Loading branch information
4 people authored Oct 10, 2024
1 parent 2125dce commit 99d6e94
Showing 1 changed file with 34 additions and 16 deletions.
50 changes: 34 additions & 16 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ on:
default: "main"
type: string
test_pypi_publish:
description: "Publish to Test PyPi (true | false)"
description: "Publish to Test PyPi"
default: false
type: boolean
pypi_publish:
description: "Publish to PyPi (true | false)"
description: "Publish to PyPi"
default: false
type: boolean

Expand All @@ -26,11 +26,11 @@ on:
default: "main"
type: string
test_pypi_publish:
description: "Publish to Test PyPi (true | false)"
description: "Publish to Test PyPi"
default: false
type: boolean
pypi_publish:
description: "Publish to PyPi (true | false))"
description: "Publish to PyPi"
default: false
type: boolean

Expand All @@ -54,28 +54,46 @@ jobs:
with:
path: dist/*

upload_pypi:
name: Upload to PyPI (optional)
upload_test_pypi:
name: Upload to test PyPI (optional)
if: ${{ github.event.inputs.test_pypi_publish == 'true' }}
needs: [build]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/fenics-ufl
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist

- name: Push to PyPI
- name: Push to test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ github.event.inputs.pypi_publish == 'true' }}
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
repository-url: https://upload.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

upload_pypi:
name: Upload to PyPI (optional)
if: ${{ github.event.inputs.pypi_publish == 'true' }}
needs: [build]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/fenics-ufl
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist

- name: Push to Test PyPI
- name: Push to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ github.event.inputs.test_pypi_publish == 'true' }}
with:
user: __token__
password: ${{ secrets.PYPI_TEST_TOKEN }}
repository-url: https://test.pypi.org/legacy/
repository-url: https://pypi.org/legacy/

0 comments on commit 99d6e94

Please sign in to comment.