Skip to content

Commit b589201

Browse files
authored
Update python-publish.yml
fix publish pkg ci
1 parent 8b9165f commit b589201

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed
Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
# This workflows will upload a Python Package using Twine when a release is created
1+
# This workflow will upload a Python Package using Twine when a release is created
22
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
33

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+
49
name: Upload Python Package
510

611
on:
712
release:
8-
types: [created]
13+
types: [published]
914

1015
jobs:
1116
deploy:
@@ -14,24 +19,18 @@ jobs:
1419

1520
steps:
1621
- uses: actions/checkout@v2
17-
- run: |
18-
# Hack to get setup-python to work on act
19-
if [ ! -f "/etc/lsb-release" ] ; then
20-
echo "DISTRIB_RELEASE=18.04" > /etc/lsb-release
21-
fi
2222
- name: Set up Python
2323
uses: actions/setup-python@v2
2424
with:
25-
python-version: '3.6.x'
25+
python-version: '3.x'
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
pip install setuptools wheel twine
30-
pip install -r requirements.txt
31-
- name: Build and publish
32-
env:
33-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
34-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
35-
run: |
36-
python setup.py sdist bdist_wheel
37-
twine upload dist/*
29+
pip install build
30+
- name: Build package
31+
run: python -m build
32+
- name: Publish package
33+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
34+
with:
35+
user: ${{ secrets.PYPI_USERNAME }}
36+
password: ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)