Skip to content

Commit 42fdd99

Browse files
authored
fix twine publish failed
1 parent b589201 commit 42fdd99

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
1+
# This workflows 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-
94
name: Upload Python Package
105

116
on:
127
release:
13-
types: [published]
8+
types: [created]
149

1510
jobs:
1611
deploy:
@@ -19,18 +14,24 @@ jobs:
1914

2015
steps:
2116
- 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.x'
25+
python-version: '3.6.x'
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
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 }}
29+
pip install setuptools wheel
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+
pipx run twine upload dist/*

0 commit comments

Comments
 (0)