Skip to content

Commit b5ec7c7

Browse files
authored
ci: release with trusted publisher and attestations (#5196)
* ci: release with trusted publisher and attestations Signed-off-by: Henry Schreiner <[email protected]> * Update pip.yml --------- Signed-off-by: Henry Schreiner <[email protected]>
1 parent 26281c7 commit b5ec7c7

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

.github/workflows/pip.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858

5959
- name: Prepare env
6060
run: |
61-
python -m pip install -r tests/requirements.txt build twine
61+
python -m pip install -r tests/requirements.txt build twine!=5.1.0
6262
6363
- name: Python Packaging tests
6464
run: pytest tests/extra_python_package/
@@ -91,23 +91,27 @@ jobs:
9191
runs-on: ubuntu-latest
9292
if: github.event_name == 'release' && github.event.action == 'published'
9393
needs: [packaging]
94+
environment: pypi
95+
permissions:
96+
id-token: write
97+
attestations: write
98+
contents: read
9499

95100
steps:
96-
- uses: actions/setup-python@v5
97-
with:
98-
python-version: "3.x"
99-
100101
# Downloads all to directories matching the artifact names
101102
- uses: actions/download-artifact@v4
102103

104+
- name: Generate artifact attestation for sdist and wheel
105+
uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
106+
with:
107+
subject-path: "*/pybind11*"
108+
103109
- name: Publish standard package
104110
uses: pypa/gh-action-pypi-publish@release/v1
105111
with:
106-
password: ${{ secrets.pypi_password }}
107112
packages-dir: standard/
108113

109114
- name: Publish global package
110115
uses: pypa/gh-action-pypi-publish@release/v1
111116
with:
112-
password: ${{ secrets.pypi_password_global }}
113117
packages-dir: global/

0 commit comments

Comments
 (0)