Skip to content

Commit

Permalink
add a worfklow to publish to pypi on release
Browse files Browse the repository at this point in the history
  • Loading branch information
agrouaze committed Jun 12, 2023
1 parent 131485b commit 7186a33
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Upload package to PyPI

on:
release:
types: [created]

jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip build twine
- name: Build
run: |
python -m build --sdist --wheel .
- name: Check the built archives
run: |
twine check dist/*
pip install dist/*.whl
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_token }}
repository_url: https://upload.pypi.org/legacy/
verify_metadata: true

0 comments on commit 7186a33

Please sign in to comment.