Skip to content

deploy with github too #9

deploy with github too

deploy with github too #9

Workflow file for this run

name: Python CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", 3.11, 3.12]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel poetry
make setup
- name: Lint and run tests
run: |
make lint
make coverage
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
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 setuptools wheel poetry
python -m pip install coveralls
make setup
- name: Run coverage and upload to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
make coverage
coveralls
deploy:
if: startsWith(github.ref, 'refs/tags/') && github.ref_type == 'tag'
runs-on: ubuntu-latest
needs:
- build
- coverage
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config http-basic.pypi __token__ ${{ secrets.PYPI_PASSWORD }}
- name: Publish to PyPI
env:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: make publish