Skip to content

Commit

Permalink
Add GitHub action to publish to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolab committed Sep 23, 2022
1 parent 669c965 commit 7394651
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish to PyPI

on:
release:
types: [released, prereleased]

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel
- name: Build
run: python setup.py sdist bdist_wheel

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: '__token__'
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 7394651

Please sign in to comment.