Use uv for build noxenv too. #1159
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: CI | |
on: | |
push: | |
branches-ignore: | |
- "wip*" | |
tags: | |
- "v*" | |
pull_request: | |
schedule: | |
# Daily at 3:11 | |
- cron: "11 3 * * *" | |
workflow_dispatch: | |
jobs: | |
list: | |
runs-on: ubuntu-latest | |
outputs: | |
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
- id: noxenvs-matrix | |
run: | | |
echo >>$GITHUB_OUTPUT noxenvs=$( | |
uvx 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) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: > | |
sudo apt-get update && | |
sudo apt-get install -y libenchant-2-dev libxml2-dev libxslt-dev | |
if: runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs') | |
- name: Install dependencies | |
run: brew install enchant | |
if: runner.os == 'macOS' && startsWith(matrix.noxenv, 'docs') | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.11 | |
3.12 | |
3.13 | |
allow-prereleases: true | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
- name: Run nox | |
run: uvx nox -s "${{ matrix.noxenv }}" | |
packaging: | |
needs: ci | |
runs-on: ubuntu-latest | |
environment: | |
name: PyPI | |
url: https://pypi.org/p/sphinx-json-schema-spec | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
- name: Build our distributions | |
run: uv run --with 'build[uv]' -m build --installer=uv | |
- 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 |