Skip to content

Commit 45e853d

Browse files
committed
updated publish workflow for pypi upload
1 parent 27fdb18 commit 45e853d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,26 @@ on:
1212
jobs:
1313
deploy:
1414
runs-on: ubuntu-latest
15+
environment: pypi
16+
permissions:
17+
id-token: write
18+
contents: read
1519
steps:
1620
- name: Check out code
1721
uses: actions/checkout@v4
1822
- name: Set up Python
19-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v5
2024
with:
2125
python-version: "3.x"
2226
- name: Install dependencies
2327
run: |
2428
python -m pip install --upgrade pip
25-
pip install build twine
29+
pip install build
2630
- name: Update version number
2731
run: |
2832
VERSION="${{ inputs.version || github.ref_name }}"
2933
sed -i "s/version = \".*\"/version = \"$VERSION\"/" pyproject.toml
30-
- name: Build and publish
31-
env:
32-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
33-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
34-
run: |
35-
python -m build
36-
twine upload dist/*
34+
- name: Build package
35+
run: python -m build
36+
- name: Publish to PyPI
37+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)