Use uvx to hopefully solve https://cibuildwheel.pypa.io/en/stable/faq… #3
Workflow file for this run
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: release | |
on: | |
push: | |
tags: | |
- v* | |
pull_request: | |
jobs: | |
builds: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
# - uses: actions/setup-python@v5 | |
# with: | |
# python-version: "3.11" | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Build wheels | |
run: uvx --python 3.12 cibuildwheel==2.22.0 --output-dir dist | |
env: | |
CIBW_BEFORE_BUILD: pip install Cython==3.0.11 && pip install -e . && python build.py | |
CIBW_TEST_REQUIRES: pytest | |
CIBW_TEST_COMMAND: pytest --showlocals {package}/tests | |
CIBW_SKIP: "{pp*}" | |
CIBW_ARCHS_MACOS: x86_64 arm64 | |
CIBW_ARCHS_LINUX: auto aarch64 | |
CIBW_BUILD_VERBOSITY: 3 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheelhouse-${{ matrix.os }} | |
path: dist | |
upload: | |
# Skip this step on pull requests. Run only when pushing a version tag. | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: builds | |
runs-on: ubuntu-latest | |
environment: | |
name: release | |
url: https://pypi.org/p/textual-tree-sitter-languages | |
permissions: | |
id-token: write # Mandatory for trusted publishing to PyPI | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Stage wheels | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: wheelhouse-* | |
merge-multiple: true | |
path: dist | |
- run: | | |
ls -l dist/ | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |