📦️Upload PyPi Package #5
Workflow file for this run
This file contains hidden or 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: 📦️Upload PyPi Package | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Cache Poetry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pypoetry | |
~/.cache/pip | |
key: ${{ runner.os }}-poetry-3.10-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-poetry-3.10- | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.venv | |
key: ${{ runner.os }}-poetry-dependencies-3.10-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-poetry-dependencies-3.10- | |
- name: Install dependencies | |
run: | | |
poetry install | |
- name: Publish to PyPI | |
env: | |
POETRY_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
poetry publish --build --username __token__ --password $POETRY_PYPI_TOKEN |