Skip to content

v0.1.3

v0.1.3 #6

Workflow file for this run

name: Release - PyPI
on:
release:
types: [published]
workflow_dispatch:
inputs:
index:
description: 'Target index (pypi or testpypi)'
required: true
default: 'testpypi'
type: choice
options:
- testpypi
- pypi
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
environment:
name: pypi
steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build package
run: python -m build
- name: Check distribution
run: |
twine check dist/*
if [ $? -ne 0 ]; then
echo "Invalid distribution files"
exit 1
fi
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: ${{ github.event.inputs.index == 'pypi' && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }}
packages-dir: dist/
verbose: true