Skip to content

Commit

Permalink
Merge pull request #386 from jpopelka/pypi-publish-github-action
Browse files Browse the repository at this point in the history
Github action/workflow to upload release to PyPI
  • Loading branch information
jpopelka committed Mar 12, 2021
2 parents 29a7257 + 2be2dff commit 0d89625
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Upload a Python package when a release is created
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows

name: Publish Python 🐍 distributions 📦 to PyPI

on:
release:
types: [created]

jobs:
build-n-publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2

- name: Build a source tarball and a binary wheel
# https://pypa-build.readthedocs.io
run: |
python -m pip install build
python -m build --sdist --wheel
- name: Publish 📦 to PyPI
# https://github.com/pypa/gh-action-pypi-publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
# secrets.PYPI_API_TOKEN is set to usercont-release-bot user token
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true

0 comments on commit 0d89625

Please sign in to comment.