Skip to content

0.1.0

0.1.0 #3

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
workflow_dispatch:
inputs:
repository:
description: 'PyPI repository to publish to (pypi or testpypi)'
required: true
default: 'pypi'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for private repositories and trusted publishers
steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: '3.9'
cache: true
- name: Build Package
run: pdm build
- name: Set Repository
if: github.event_name == 'workflow_dispatch'
run: echo "PYPI_REPOSITORY=${{ github.event.inputs.repository }}" >> $GITHUB_ENV
- name: Publish Package
run: |
pdm publish --repository ${{ env.PYPI_REPOSITORY || 'pypi' }}