update wheel to macos-14 #90
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: Test Build wheels and Deploy | |
| # Build on every branch push, tag push, and pull request change: | |
| on: [push, pull_request] | |
| # Alternatively, to publish when a (published) GitHub Release is created, use the following: | |
| # on: | |
| # push: | |
| # pull_request: | |
| # release: | |
| # types: | |
| # - published | |
| jobs: | |
| test_code: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up uv and Python ${{ matrix.python-version }} | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --group dev | |
| - name: Lint with flake8 | |
| run: | | |
| # stop the build if there are Python syntax errors or undefined names | |
| uv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .venv | |
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
| uv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| - name: Test with pytest | |
| run: | | |
| cd unittest && uv run pytest | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| needs: [ test_code ] | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/pr-branch' | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest, windows-2022, macos-14 ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| - name: Install cibuildwheel | |
| run: python -m pip install cibuildwheel==2.17.0 | |
| - name: Build wheels (cp310+) | |
| run: python -m cibuildwheel --output-dir wheelhouse | |
| env: | |
| CIBW_BEFORE_BUILD: pip install numpy setuptools | |
| CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* | |
| CIBW_ARCHS_MACOS: x86_64 universal2 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
| path: ./wheelhouse/*.whl | |
| build_sdist: | |
| name: Build source distribution | |
| needs: [ test_code ] | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/pr-branch' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Build sdist | |
| run: uv build --sdist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cibw-sdist | |
| path: dist/*.tar.gz | |
| upload_pypi: | |
| needs: [build_wheels, build_sdist, test_code] | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' | |
| # upload to PyPI on every tag starting with 'v' | |
| # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| # alternatively, to publish when a GitHub Release is created, use the following rule: | |
| # if: github.event_name == 'release' && github.event.action == 'published' | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| # unpacks all CIBW artifacts into dist/ | |
| pattern: cibw-* | |
| path: dist | |
| merge-multiple: true | |
| - uses: pypa/gh-action-pypi-publish@v1.4.2 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| # repository_url: https://test.pypi.org/legacy/ | |
| skip_existing: true |