Skip to content

Commit 737cd7c

Browse files
jhalechrisrichardsonmichalhaberagarth-wells
authored
pypi trusted publishing (#314)
* 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. * Simplify. --------- Co-authored-by: Chris Richardson <[email protected]> Co-authored-by: Michal Habera <[email protected]> Co-authored-by: Garth N. Wells <[email protected]>
1 parent 2125dce commit 737cd7c

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

.github/workflows/build-wheels.yml

+33-17
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ on:
1111
default: "main"
1212
type: string
1313
test_pypi_publish:
14-
description: "Publish to Test PyPi (true | false)"
14+
description: "Publish to Test PyPi"
1515
default: false
1616
type: boolean
1717
pypi_publish:
18-
description: "Publish to PyPi (true | false)"
18+
description: "Publish to PyPi"
1919
default: false
2020
type: boolean
2121

@@ -26,11 +26,11 @@ on:
2626
default: "main"
2727
type: string
2828
test_pypi_publish:
29-
description: "Publish to Test PyPi (true | false)"
29+
description: "Publish to Test PyPi"
3030
default: false
3131
type: boolean
3232
pypi_publish:
33-
description: "Publish to PyPi (true | false))"
33+
description: "Publish to PyPi"
3434
default: false
3535
type: boolean
3636

@@ -54,28 +54,44 @@ jobs:
5454
with:
5555
path: dist/*
5656

57-
upload_pypi:
58-
name: Upload to PyPI (optional)
57+
upload_test_pypi:
58+
name: Upload to test PyPI (optional)
59+
if: ${{ github.event.inputs.test_pypi_publish == 'true' }}
5960
needs: [build]
6061
runs-on: ubuntu-latest
62+
environment:
63+
name: testpypi
64+
url: https://test.pypi.org/p/fenics-ufl
65+
permissions:
66+
id-token: write
67+
6168
steps:
6269
- uses: actions/download-artifact@v4
6370
with:
6471
name: artifact
6572
path: dist
6673

67-
- name: Push to PyPI
74+
- name: Push to test PyPI
6875
uses: pypa/gh-action-pypi-publish@release/v1
69-
if: ${{ github.event.inputs.pypi_publish == 'true' }}
7076
with:
71-
user: __token__
72-
password: ${{ secrets.PYPI_TOKEN }}
73-
repository-url: https://upload.pypi.org/legacy/
77+
repository-url: https://test.pypi.org/legacy/
78+
79+
upload_pypi:
80+
name: Upload to PyPI (optional)
81+
if: ${{ github.event.inputs.pypi_publish == 'true' }}
82+
needs: [build]
83+
runs-on: ubuntu-latest
84+
environment:
85+
name: pypi
86+
url: https://pypi.org/p/fenics-ufl
87+
permissions:
88+
id-token: write
89+
90+
steps:
91+
- uses: actions/download-artifact@v4
92+
with:
93+
name: artifact
94+
path: dist
7495

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

0 commit comments

Comments
 (0)