Skip to content

Commit 3beb19f

Browse files
authored
Update publish.yml
1 parent 3850005 commit 3beb19f

File tree

1 file changed

+32
-23
lines changed

1 file changed

+32
-23
lines changed

.github/workflows/publish.yml

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
4-
name: Upload Python Package
1+
name: Publish to PyPI
52

63
on:
74
release:
8-
types: [created]
5+
types: [published]
96

107
jobs:
11-
deploy:
12-
8+
publish:
139
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
1412

1513
steps:
16-
- uses: actions/checkout@v4
17-
- name: Set up Python
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: '3.x'
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
25-
- name: Build and publish
26-
env:
27-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29-
run: |
30-
python setup.py sdist bdist_wheel
31-
twine upload dist/*
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.x'
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install build twine
25+
26+
- name: Build package
27+
run: python -m build
28+
29+
- name: Publish to PyPI
30+
uses: pypa/[email protected]
31+
with:
32+
user: __token__
33+
password: ${{ secrets.PYPI_API_TOKEN }}
34+
35+
- name: Publish to Test PyPI
36+
uses: pypa/[email protected]
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_API_TOKEN }}
40+
repository_url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)