Skip to content

Commit aa9320e

Browse files
committed
update python publish
1 parent d031ae8 commit aa9320e

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

.github/workflows/pythonpublish.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
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.
8+
19
name: Upload Python Package
210

311
on:
412
release:
5-
types: [created]
13+
types: [published]
14+
15+
permissions:
16+
contents: read
617

718
jobs:
819
deploy:
20+
921
runs-on: ubuntu-latest
22+
1023
steps:
11-
- uses: actions/checkout@v1
24+
- uses: actions/checkout@v3
1225
- name: Set up Python
13-
uses: actions/setup-python@v1
26+
uses: actions/setup-python@v3
1427
with:
15-
python-version: '3.8'
28+
python-version: '3.x'
1629
- name: Install dependencies
1730
run: |
1831
python -m pip install --upgrade pip
19-
pip install setuptools==42.0.2 wheel twine
20-
- name: Build and publish
21-
env:
22-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24-
run: |
25-
python setup.py sdist bdist_wheel
26-
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)