Skip to content

Publish Python library #3

Publish Python library

Publish Python library #3

Workflow file for this run

name: Publish Python library
on:
workflow_dispatch:
env:
GITHUB_REF: "${{ github.ref }}"
jobs:
build_and_publish:
name: Build distribution of library
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip' # caching pip dependencies
- name: Prepare build
run: python3 -m pip install --upgrade build
- name: Install Twine
run: python3 -m pip install --upgrade twine
- name: Build package
run: python3 -m build
- name: Check distribution
run: python3 -m twine check --strict dist/*
- name: Publish package
run: python3 -m twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}