Publish Python 🐍 distributions 📦 to PyPI and TestPyPI and create Github Release #76
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI and create Github Release | |
on: | |
push: | |
# remove branchname otherwise github actions will trigger event regardless of tag. | |
tags: v[0-9]+.[0-9]+* | |
jobs: | |
builds-n-publish: | |
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + github release | |
runs-on: ubuntu-18.04 | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.7 | |
- name: Install setuptools | |
run: >- | |
python -m pip install --user --upgrade setuptools wheel | |
- name: Build a binary wheel and source tarball | |
run: >- | |
python setup.py sdist bdist_wheel | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} | |
- name: Upload to release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: ${{ secrets.RELEASE_TOKEN }} | |
prerelease: false | |
draft: true | |
files: dist/* |