Skip to content

Commit 8116454

Browse files
authored
chore: Use OIDC for publishing (zarr-developers#3791)
* Use OIDC for publishing * Update requires * Attest
1 parent 9a71d59 commit 8116454

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

.github/workflows/releases.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
permissions:
1111
contents: read
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418

1519
build_artifacts:
@@ -35,7 +39,7 @@ jobs:
3539
version: '1.16.5'
3640
- name: Build wheel and sdist
3741
run: hatch build
38-
- uses: actions/upload-artifact@v6
42+
- uses: actions/upload-artifact@v7
3943
with:
4044
name: releases
4145
path: dist
@@ -55,16 +59,24 @@ jobs:
5559
ls dist
5660
5761
upload_pypi:
58-
needs: [build_artifacts]
62+
needs: [build_artifacts, test_dist_pypi]
5963
runs-on: ubuntu-latest
6064
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
65+
environment:
66+
name: releases
67+
url: https://pypi.org/p/zarr
68+
permissions:
69+
id-token: write
70+
attestations: write
71+
artifact-metadata: write
6172
steps:
6273
- uses: actions/download-artifact@v7
6374
with:
6475
name: releases
6576
path: dist
66-
- uses: pypa/gh-action-pypi-publish@v1.13.0
77+
- name: Generate artifact attestation
78+
uses: actions/attest@v4
6779
with:
68-
user: __token__
69-
password: ${{ secrets.pypi_password }}
70-
# To test: repository_url: https://test.pypi.org/legacy/
80+
subject-path: dist/*
81+
- name: Publish package to PyPI
82+
uses: pypa/gh-action-pypi-publish@v1.13.0

0 commit comments

Comments
 (0)