release #1
This file contains 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: release | |
on: | |
workflow_dispatch: | |
inputs: | |
dry_run: | |
description: 'Dry run' | |
required: false | |
type: boolean | |
default: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
if: ${{ github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install -e ".[dev]" -U | |
- name: Lint with Ruff | |
run: | | |
ruff --output-format=github . | |
- name: Test with Pytest | |
run: | | |
pytest --cov --cov-report xml:codecov.xml | |
- name: Code coverage | |
uses: orgoro/coverage@v3.1 | |
with: | |
coverageFile: codecov.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
name: Deploy | |
if: ${{ github.ref == 'refs/heads/main' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install -e ".[dev]" -U | |
- name: Deploy | |
run: | | |
python setup.py sdist | |
python setup.py bdist_wheel | |
twine upload dist/* --skip-existing --verbose -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} | |