Skip to content

Commit eed2c82

Browse files
committed
new pypi publish
1 parent 9d451cc commit eed2c82

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

.github/workflows/publish.yml

+21-13
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
# This workflows 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
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
38

49
name: Upload Python Package
510

611
on:
712
release:
8-
types: [created]
13+
types: [published]
14+
15+
permissions:
16+
contents: read
917

1018
jobs:
1119
deploy:
1220

1321
runs-on: ubuntu-latest
1422

1523
steps:
16-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v3
1725
- name: Set up Python
18-
uses: actions/setup-python@v4
26+
uses: actions/setup-python@v3
1927
with:
2028
python-version: '3.x'
2129
- name: Install dependencies
2230
run: |
2331
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/*
32+
pip install build
33+
- name: Build package
34+
run: python -m build
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)