Skip to content

Publish to PyPI

Publish to PyPI #2

Workflow file for this run

name: Publish to PyPI
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install packages
run: >-
python -m pip install build twine
- name: Get version from file
id: version
run: echo "version=$(cat version)" >> $GITHUB_OUTPUT
- name: Validate package versions
run: >-
test $GITHUB_REF == ${{ steps.version.outputs.version }}
- name: Build
run: >-
python -m build mkdocs
- name: Upload
run: >-
twine upload mkdocs/dist/* ${{ secrets.PYPI_API_TOKEN }}