diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index 97e7f1e..4ed6b4f 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -10,42 +10,24 @@ permissions: id-token: write jobs: - build-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - cache: 'pip' - - run: | - pip install auditwheel patchelf - pip wheel . -w wheel - auditwheel repair -w dist --plat=manylinux_2_17_x86_64 wheel/*.whl - - uses: actions/upload-artifact@v4 - with: - name: python-package-linux - path: dist/*.whl - - build-macos: - runs-on: macos-latest + build-wheels: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - cache: 'pip' - - run: | - pip wheel . -w dist + - name: Build wheels + uses: pypa/cibuildwheel@v2.21.3 - uses: actions/upload-artifact@v4 with: - name: python-package-macos - path: dist/*.whl + name: python-package-${{ matrix.os }} + path: ./wheelhouse/*.whl publish: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') runs-on: ubuntu-latest - needs: [build-linux, build-macos] + needs: [build-wheels] environment: name: pypi url: https://pypi.org/p/pylc3 @@ -53,5 +35,5 @@ jobs: - uses: actions/download-artifact@v4 with: merge-multiple: true - path: dist/ + path: wheelhouse/ - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index ec11a96..8567b96 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ bin build test/build *__pycache__ +wheelhouse diff --git a/pyproject.toml b/pyproject.toml index 3de5361..ab0ccff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,3 +20,6 @@ Homepage = "https://github.com/google/liblc3" [tool.meson-python.args] setup = ['-Dpython=true'] + +[tool.cibuildwheel] +skip = "pp* cp36-* cp37-* cp38-* cp39-*"