Skip to content

🔧 add the action to publish package #1

🔧 add the action to publish package

🔧 add the action to publish package #1

Workflow file for this run

name: Upload Python Package
on:
push:
branches: [main]
tags:
- v*
pull_request:
branches: [main]
jobs:
publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
rm -fr dist/ && poetry build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}