Skip to content

Package/publish

Package/publish #9

name: Package and publish
on:
workflow_dispatch:
release:
types: [published]
jobs:
deploysdist:
name: "Deploy to Pypi"
runs-on: ${{ vars.RUNNER }}
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- name: Create distributions
shell: bash -l {0}
run: |
python -m pip install -U build pip
python -m build
- name: Publish package to PyPI
# upload to PyPI on every release for a tag starting with 'v'
# if: github.event.action == 'published' && startsWith(github.event.release.tag_name, 'v')
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: ${{ secrets.PYPI_USER }}
password: ${{ secrets.PYPI_PASSWORD }}