Skip to content

Publish

Publish #2

Workflow file for this run

name: Publish
on:
workflow_dispatch:
push:
branches: [main]
defaults:
run:
shell: bash
jobs:
deploy:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.11
- name: Cache dependencies
id: cache_dep
uses: actions/[email protected]
with:
key: dependencies-${{ hashFiles('**/poetry.lock') }}
path: ${{ github.workspace }}/venv
- name: Install dependencies
if: steps.cache.cache-hit != 'true'
run: |
python -m pip install -U pip poetry
poetry --version
poetry check --no-interaction
poetry config virtualenvs.in-project true
poetry install --no-interaction
- name: Run tests
run: |
poetry run pytest -v
- name: Build package
run: |
poetry build --no-interaction
- name: Publish to PyPi
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build --no-interaction