Skip to content

Commit 2ef36ea

Browse files
authored
Merge pull request #244 from agilescientific/trusted-publishers-pypi
Update github action for trusted publisher to pypi
2 parents 4cd1812 + 4b61624 commit 2ef36ea

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

.github/workflows/pypi-release.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,31 @@ on:
1313
types: [ published ]
1414

1515
jobs:
16-
deploy:
17-
16+
build_wheel:
17+
name: Build wheel
1818
runs-on: ubuntu-latest
1919

2020
steps:
21-
- uses: actions/checkout@v2
22-
- name: Set up Python
23-
uses: actions/setup-python@v2
21+
- uses: actions/checkout@v4
2422
with:
25-
python-version: '3.x'
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install build
30-
- name: Build package
31-
run: |
32-
python -m build
33-
- name: Publish package
34-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
23+
fetch-depth: 0
24+
- uses: hynek/build-and-inspect-python-package@v2
25+
26+
deploy:
27+
needs: [build_wheel]
28+
name: Publish to PyPI
29+
runs-on: ubuntu-latest
30+
permissions:
31+
id-token: write
32+
attestations: write
33+
contents: read
34+
if: github.event_name == 'release' && github.event.action == 'published'
35+
36+
steps:
37+
- uses: actions/download-artifact@v4
3538
with:
36-
user: __token__
37-
password: ${{ secrets.PYPI_API_TOKEN }}
39+
name: Packages
40+
path: dist
41+
- name: Publish to PyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+

0 commit comments

Comments
 (0)