|
| 1 | +name: Build Python wheels |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + tags: 'v*' |
| 7 | + pull_request: |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-python-wheels: |
| 12 | + name: Build wheels on ${{ matrix.os }} with Python ${{ matrix.python-version }} |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest] #, windows-latest, macos-13, macos-14] |
| 17 | + # python-version: ['cp310', 'cp311'] |
| 18 | + python-version: ['3.10', '3.11'] |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Set up rust |
| 24 | + uses: dtolnay/rust-toolchain@stable |
| 25 | + with: |
| 26 | + toolchain: stable |
| 27 | + |
| 28 | + - name: Check Rust versions |
| 29 | + run: | |
| 30 | + rustc --version |
| 31 | + which rustc |
| 32 | + cargo --version |
| 33 | + which cargo |
| 34 | + rustup --version |
| 35 | + which rustup |
| 36 | +
|
| 37 | + - name: Set up Python # Used to host cibuildwheel |
| 38 | + uses: actions/setup-python@v3 |
| 39 | + with: |
| 40 | + python-version: ${{ matrix.python-version }} |
| 41 | + architecture: x64 |
| 42 | + |
| 43 | + # - name: Install cibuildwheel |
| 44 | + # run: python -m pip install cibuildwheel==2.16.5 |
| 45 | + |
| 46 | + - name: Install maturin |
| 47 | + run: python -m pip install maturin |
| 48 | + |
| 49 | + - name: Build wheels |
| 50 | + run: | |
| 51 | + cd lakers-python |
| 52 | + maturin build --out wheelhouse |
| 53 | + # python -m cibuildwheel --output-dir wheelhouse |
| 54 | + # env: |
| 55 | + # CIBW_BUILD: '${{ matrix.python-version }}-*' |
| 56 | + # CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH" CARGO_TERM_COLOR="always"' |
| 57 | + # CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"' |
| 58 | + # # CIBW_BEFORE_BUILD: rustup show |
| 59 | + |
| 60 | + - uses: actions/upload-artifact@v4 |
| 61 | + with: |
| 62 | + name: wheels-${{ matrix.os }}-${{ strategy.job-index }} |
| 63 | + path: ./lakers-python/wheelhouse/*.whl |
0 commit comments