Skip to content

Commit 019f8db

Browse files
authored
Merge pull request #73 from paulromano/update-pypi-action
Update GitHub actions for publishing to PyPI
2 parents 807d969 + 4c61b03 commit 019f8db

2 files changed

Lines changed: 17 additions & 58 deletions

File tree

.github/workflows/python-publish-testpypi.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
1-
# This yml file will trigger a Github Actions event that builds and upload the
2-
# Python package to PiPy. This makes use of Twine and is triggered when a push
3-
# to the master branch occures. For more information see:
4-
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
5-
61
name: Upload Python Package
72

83
on:
94
release:
10-
types: [created]
5+
types: [published]
116

127
jobs:
138
deploy:
14-
159
runs-on: ubuntu-latest
16-
1710
steps:
18-
- uses: actions/checkout@v2
19-
- name: Set up Python
20-
uses: actions/setup-python@v2
21-
with:
22-
python-version: '3.x'
23-
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install setuptools wheel twine
27-
- name: Build and publish
28-
env:
29-
TWINE_USERNAME: __token__
30-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
31-
run: |
32-
python setup.py sdist bdist_wheel
33-
twine upload dist/*
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: '3.x'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install build
20+
- name: Build package
21+
run: python -m build
22+
- name: Publish a Python distribution to PyPI
23+
uses: pypa/gh-action-pypi-publish@release/v1
24+
with:
25+
user: __token__
26+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)