Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/publish-on-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish release to PyPI

on:
workflow_dispatch:
release:
types: [published]

jobs:
build-and-upload:
runs-on: ubuntu-latest

steps:
- name: Check out the release commit
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python packages needed for build and upload
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build sdist and wheel
run: |
python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m twine check --strict dist/*
python -m twine upload dist/*
1 change: 1 addition & 0 deletions docs/releases/upcoming/315.build.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add GitHub Actions workflow for automatically publishing releases to PyPI. (#315)