Skip to content

CI

CI #303

Workflow file for this run

name: CI
on:
push:
pull_request:
release:
types: [published]
schedule:
# Daily at 4:21
- cron: "21 4 * * *"
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"
PYTHON_LATEST: "3.11"
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_LATEST }}
- uses: pre-commit/action@v3.0.0
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libenchant-2-dev
if: runner.os == 'Linux'
- name: Install dependencies
run: brew install enchant
if: runner.os == 'macOS'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_LATEST }}
- name: Set up nox
uses: wntrblm/nox@2022.11.21
- name: Run nox
run: nox
packaging:
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_LATEST }}
- name: Install dependencies
run: python -m pip install build
- name: Create packages
run: python -m build .
- name: Set up nox
uses: wntrblm/nox@2022.11.21
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
- name: Create a Release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: softprops/action-gh-release@v1
with:
files: |
dist/*
generate_release_notes: true