Skip to content

Commit

Permalink
Add workflow to publish to PyPI
Browse files Browse the repository at this point in the history
Along with the existing workflow that can publish to
Test PyPI, this change also adds official PyPI.

The difference is that this workflow will only publish
if the commit is tagged.

Signed-off-by: Eric Brown <browne@vmware.com>
  • Loading branch information
ericwb committed Dec 6, 2020
1 parent 0e46368 commit 044063e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/publish-to-pypi.yml
@@ -0,0 +1,29 @@
name: Publish to PyPI

on: workflow_dispatch

jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: pip install wheel

- name: Build a binary wheel and a source tarball
run: |
python setup.py sdist bdist_wheel
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}

0 comments on commit 044063e

Please sign in to comment.