Prepare release 0.2.0 (#43) #6
This file contains hidden or 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: | |
| - main | |
| tags: | |
| - '**' | |
| pull_request: {} | |
| permissions: | |
| contents: read | |
| jobs: | |
| tests: | |
| name: Run tests with pytest | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15'] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions) | |
| - name: Install tox | |
| run: uv tool install --managed-python --python 3.13 tox --with tox-uv --with tox-gh | |
| - name: Install Python ${{ matrix.python-version }} | |
| run: uv python install --managed-python ${{ matrix.python-version }} | |
| - name: Test with tox | |
| run: tox run | |
| env: | |
| TOX_GH_MAJOR_MINOR: ${{ matrix.python-version }} | |
| UV_PYTHON_DOWNLOADS: never | |
| docs: | |
| name: Build and check documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python 3.14 | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| python-version: '3.14' | |
| enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions) | |
| - name: Install dependencies | |
| run: uv sync --group docs | |
| - name: Lint docs with sphinx-lint | |
| run: | | |
| uv run sphinx-lint docs | |
| - name: Build docs and check the integrity of external links | |
| run: | | |
| uv run sphinx-build --builder linkcheck --fail-on-warning "source" "build" | |
| uv run sphinx-build --builder html --fail-on-warning "source" "build" | |
| working-directory: ./docs | |
| build: | |
| name: Build project | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| enable-cache: false | |
| - run: uv sync --no-install-project --only-group build | |
| - name: Build library | |
| run: uv run --no-sync python -m build --installer uv | |
| - run: ls -lh dist/ | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: pypi_files | |
| path: dist | |
| release: | |
| needs: [tests, docs, build] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| environment: release | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| enable-cache: false | |
| - run: uv sync --no-install-project --only-group build | |
| - name: Get dist artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: pypi_files | |
| path: dist | |
| - name: Test artifacts integrity | |
| run: | | |
| for whl in dist/*.whl; do unzip -qt "$whl"; done | |
| uv run --no-sync twine check --strict dist/* | |
| - name: Upload package to PyPI | |
| uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 | |
| with: | |
| packages-dir: dist/ |