Skip to content

Publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI #4

Publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI

Publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI #4

Workflow file for this run

name: Publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI
on:
release:
types: [published]
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10 🐍🐍🐍
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Install poetry
run: |
python -m pip install poetry
- name: Install dependencies through Poetry
run: |
python -m poetry install --with dev
- name: Publish distribution πŸ“¦ to PyPI
if: startsWith(github.event.ref, 'refs/tags')
env:
PYPI_TOKEN: ${{ secrets.pypi_deploy }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build