Publish Python Package #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Python Package | |
on: | |
release: | |
types: [published] | |
# workflow_dispatch: | |
workflow_run: | |
workflows: [Create Release] | |
types: [completed] | |
permissions: | |
contents: read | |
jobs: | |
pypi-publish: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.release }} | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publisher | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@v3 | |
- name: Publish package to PyPI | |
run: pdm publish |