Skip to content

Commit 8eaeec8

Browse files
authored
GHA/pypi: trusted publishing (#208)
No need for long-lived API tokens anymore. see https://docs.pypi.org/trusted-publishers/
1 parent 106d9f9 commit 8eaeec8

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
jobs:
88
deploy:
99
runs-on: ubuntu-latest
10+
environment:
11+
name: pypi
12+
url: https://pypi.org/p/sbmlmath
13+
permissions:
14+
id-token: write
1015

1116
steps:
1217
- name: Check out repository
@@ -15,14 +20,12 @@ jobs:
1520
uses: actions/setup-python@v4
1621
with:
1722
python-version: 3.11
18-
- name: Install dependencies
23+
24+
- name: Install dependencies / build sdist
1925
run: |
2026
python -m pip install --upgrade pip
21-
pip install setuptools wheel twine
22-
- name: Build and publish
23-
env:
24-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
25-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
26-
run: |
27-
python setup.py sdist bdist_wheel
28-
twine upload dist/*
27+
pip install setuptools wheel build
28+
python -m build -s
29+
30+
- name: Publish a Python distribution to PyPI
31+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)