Skip to content
name: Python PyPI Builder and Publisher
on:
release:
types: [published]
jobs:
build-publish:
name: Builds and publishes a Python-based distribution to PyPI
runs-on: ubuntu-18.04
steps:
- name: Checks the Branch
# Uses the master branch of the current repository
uses: actions/checkout@master
- name: Sets the Environment
# Installs a Python 3.7 environment
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Installs pypa/build
# Install the `build` package for further building
run: >-
python -m
pip install
build
--user
- name: Builds the Wheel
# Runs the `build` command to create the wheel and source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publishes to PyPI
# Publishes the builded package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}