Skip to content

Commit 502896d

Browse files
committed
Updated deploy method
1 parent 99a8dd2 commit 502896d

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ on:
55
tags:
66
- "v*.*.*"
77
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
id-token: write
812

913
jobs:
1014
build:
11-
name: Build package
1215
runs-on: ubuntu-latest
1316
steps:
1417
- uses: actions/checkout@v4
1518
- uses: actions/setup-python@v5
1619
with:
1720
python-version: "3.10"
1821

19-
- name: Install build backend and twine
20-
run: python -m pip install --upgrade build twine
22+
- name: Install build backend
23+
run: python -m pip install --upgrade pip build
2124

2225
- name: Clean old builds
2326
run: rm -rf dist build *.egg-info
@@ -26,11 +29,12 @@ jobs:
2629
run: python -m build
2730

2831
- name: Check distribution metadata
29-
run: twine check dist/*
32+
run: python -m pip install twine && twine check dist/*
3033

31-
- name: Upload to PyPI
32-
env:
33-
TWINE_USERNAME: __token__
34-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
35-
run: twine upload dist/*
34+
- name: Publish to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1
36+
with:
37+
skip-existing: true
38+
packages-dir: dist
39+
verbose: true
3640

0 commit comments

Comments
 (0)