Skip to content

Publish to PyPI

Publish to PyPI #166

Workflow file for this run

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:
check:
uses: ./.github/workflows/checks.yml
secrets: inherit
publish:
needs: [check]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.8
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install twine
pip install ".[ci]"
- 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/*