Skip to content

Commit 04464a6

Browse files
committed
Add job to publish to PyPI
1 parent 58f8378 commit 04464a6

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/cd.yml

+36
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ on: # yamllint disable-line rule:truthy
3636
- macOS
3737
- macOS-arm64
3838
- macOS-x86_64
39+
publish-pypi:
40+
description: "Publish to PyPI"
41+
default: false
42+
type: boolean
3943
publish-anaconda:
4044
description: "Publish to Anaconda"
4145
default: false
@@ -51,6 +55,38 @@ jobs:
5155
release: ${{ inputs.release }}
5256
os-arch: ${{ inputs.os-arch }}
5357

58+
publish-pypy:
59+
if: ${{ inputs.publish-pypi }}
60+
runs-on: ubuntu-latest
61+
needs: sdist
62+
environment: # TODO: update url to pypi.org
63+
name: pypi
64+
url: https://test.pypi.org/p/${{ inputs.mpiname }}
65+
permissions:
66+
contents: read
67+
id-token: write
68+
attestations: write
69+
70+
steps:
71+
72+
- name: Download wheel artifacts
73+
uses: actions/download-artifact@v4
74+
with:
75+
path: dist
76+
pattern: wheel-*
77+
merge-multiple: true
78+
79+
- if: ${{ false }} # TODO: remove 'if' condition
80+
name: Attest wheel artifacts
81+
uses: actions/attest-build-provenance@v2
82+
with:
83+
subject-path: dist/*.whl
84+
85+
- name: Publish to PyPI
86+
uses: pypa/gh-action-pypi-publish@release/v1
87+
with: # TODO: remove repository-url
88+
repository-url: https://test.pypi.org/legacy/
89+
5490
publish-anaconda:
5591
if: ${{ inputs.publish-anaconda }}
5692
needs: wheel

0 commit comments

Comments
 (0)