Skip to content

PyPi Publish

PyPi Publish #26

Workflow file for this run

name: PyPi Publish
on:
push:
tags:
- "v*.*.*"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff mypy
test:
needs: lint
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 1
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]
env:
TOGGL_WORKSPACE_ID: ${{ secrets.TOGGL_WORKSPACE_ID }}
TOGGL_API_TOKEN: ${{ secrets.TOGGL_API_TOKEN }}
GH_ACTION: "ACTION"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry tox-gh-actions tox ruff mypy
- name: Run tests
run: tox
- name: Upload coverage reports to Codecov
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' }}
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff mypy
- name: Generate Stubs
run: stubgen toggl_api/
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
poetry_install_options: "--without=dev,docs"