Skip to content

CI

CI #1720

Workflow file for this run

name: CI
on:
push:
branches-ignore:
- "wip*"
tags:
- "v*"
pull_request:
schedule:
# Daily at 3:21
- cron: "21 3 * * *"
workflow_dispatch:
jobs:
list:
runs-on: ubuntu-latest
outputs:
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }}
steps:
- uses: actions/checkout@v4
- name: Set up nox
uses: wntrblm/nox@2024.04.15
- id: noxenvs-matrix
run: |
echo >>$GITHUB_OUTPUT noxenvs=$(
nox --list-sessions --json | jq '[.[].session]'
)
ci:
needs: list
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
noxenv: ${{ fromJson(needs.list.outputs.noxenvs) }}
posargs: [""]
include:
- os: ubuntu-latest
noxenv: "tests-3.12"
posargs: coverage github
steps:
- uses: actions/checkout@v4
- 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@v5
with:
python-version: |
3.11
3.12
pypy3.10
allow-prereleases: true
- name: Set up uv
uses: hynek/setup-cached-uv@v1
- name: Set up nox
uses: wntrblm/nox@2024.04.15
- name: Run nox
run: nox -s "${{ matrix.noxenv }}" -- ${{ matrix.posargs }}
packaging:
runs-on: ubuntu-latest
environment:
name: PyPI
url: https://pypi.org/p/mkpkg
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Set up uv
uses: hynek/setup-cached-uv@v1
- name: Install dependencies
run: uv pip install --system build
- name: Create packages
run: python -m build .
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create a Release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: softprops/action-gh-release@v2
with:
files: |
dist/*
generate_release_notes: true