Skip to content

Commit

Permalink
CI: Create Action to publish to PyPI on release
Browse files Browse the repository at this point in the history
Creates a GitHub Action workflow that builds and published packaged distribution files to PyPI when a release is published in GitHub.

The secret used in ${{ secrets.PYPI_API_TOKEN }} needs to be created on the settings page of your project on GitHub.

At some point we should probably switch to pyproject.toml as defined in PEP 518.
  • Loading branch information
EwoutH authored Feb 22, 2022
1 parent 56c598e commit 8f45478
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release
on:
release:
types:
- published

jobs:
release:
name: Deploy release to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: pip install -U pip wheel setuptools
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Upload package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}

0 comments on commit 8f45478

Please sign in to comment.