Release v4.0.0 #6
Workflow file for this run
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: Build and publish release | |
| concurrency: production | |
| on: | |
| push: | |
| tags: | |
| - v** | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build source [${{ matrix.platform }} | ${{ matrix.python-version }}] | |
| runs-on: ${{ matrix.platform }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - ubuntu-latest | |
| python-version: ["3.14"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7.1.5 | |
| with: | |
| enable-cache: true | |
| prune-cache: false | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - run: | | |
| uv build --out-dir dist-${{ matrix.platform }}-${{ matrix.python-version }} | |
| - run: | | |
| tar -cvf dist-${{ matrix.platform }}-${{ matrix.python-version }}.tar dist-${{ matrix.platform }}-${{ matrix.python-version }} | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: release-build-${{ matrix.platform }}-${{ matrix.python-version }} | |
| path: | | |
| dist-${{ matrix.platform }}-${{ matrix.python-version }}.tar | |
| build-wheels: | |
| name: Build wheels [${{ matrix.platform }} | ${{ matrix.python-version }}] | |
| runs-on: ${{ matrix.platform }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - ubuntu-latest | |
| - ubuntu-24.04-arm | |
| - macos-15-intel # intel | |
| - macos-latest # apple silicon | |
| - windows-latest | |
| - windows-11-arm | |
| python-version: ["3.14"] | |
| exclude: | |
| - platform: windows-11-arm | |
| python-version: "3.10" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7.1.5 | |
| with: | |
| enable-cache: true | |
| prune-cache: false | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Prepare build | |
| run: | | |
| uv venv --clear | |
| uv pip install tomlkit==0.13.3 'tomli==2.2.1;python_version<"3.11"' | |
| uv run bin/cibw-before-build.py | |
| - uses: pypa/cibuildwheel@v3.3.0 | |
| with: | |
| package-dir: . | |
| output-dir: wheelhouse | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: release-cibw-wheels-${{ matrix.platform }}-${{ matrix.python-version }} | |
| path: ./wheelhouse/*.whl | |
| publish-n-release: | |
| name: Publish to PyPI and generate GitHub release ${{ github.ref_name }} [${{ matrix.platform }} | ${{ matrix.python-version }}] | |
| needs: [build, build-wheels] | |
| runs-on: ${{ matrix.platform }} | |
| environment: production | |
| permissions: | |
| contents: write | |
| id-token: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - ubuntu-latest | |
| python-version: ["3.14"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7.1.5 | |
| with: | |
| enable-cache: true | |
| prune-cache: false | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| name: release-build-${{ matrix.platform }}-${{ matrix.python-version }} | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| path: release-cibw-wheels | |
| pattern: release-cibw-wheels-* | |
| merge-multiple: true | |
| - name: Build source and wheel distributions to version ${{ github.ref_name }} | |
| run: | | |
| uv build --out-dir dist-${{ matrix.platform }}-${{ matrix.python-version }} | |
| tar -xvf dist-${{ matrix.platform }}-${{ matrix.python-version }}.tar | |
| mv release-cibw-wheels/* dist-${{ matrix.platform }}-${{ matrix.python-version }}/ | |
| uv tool run twine check --strict dist-${{ matrix.platform }}-${{ matrix.python-version }}/* | |
| - name: Publish distribution to PyPI | |
| uses: pypa/gh-action-pypi-publish@v1.13.0 | |
| with: | |
| packages-dir: dist-${{ matrix.platform }}-${{ matrix.python-version }}/ | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| files: | | |
| LICENSE.txt | |
| README.md | |
| dist-${{ matrix.platform }}-${{ matrix.python-version }}/* |