Publish to PyPI #159
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to PyPI | |
# on manually trigger | |
on: | |
workflow_dispatch: | |
inputs: | |
scope: | |
description: Release scope | |
required: true | |
default: minor | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
pip install twine | |
pip install ".[ci]" | |
- name: Check sentence casing | |
run: | | |
poe check-sentence-casing | |
- name: Check options | |
run: | | |
poe check-options | |
- name: Bump version and commit change | |
run: | | |
semantic-release version --${{ github.event.inputs.scope }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and publish | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
python -m build | |
python -m twine upload dist/* |