-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combine Windows wheel job into main wheel job
- Loading branch information
1 parent
03960d3
commit eca6bd6
Showing
1 changed file
with
26 additions
and
53 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,6 @@ jobs: | |
path: dist/*.tar.gz | ||
|
||
build_wheels_matrix: | ||
if: false | ||
name: Generate matrix for building wheels | ||
runs-on: ubuntu-latest | ||
|
||
|
@@ -99,13 +98,16 @@ jobs: | |
cibuildwheel --print-build-identifiers --platform linux \ | ||
| sed 's/.*/{"cibw-only": "&", "os": "ubuntu-20.04"}/' \ | ||
&& cibuildwheel --print-build-identifiers --platform macos \ | ||
| sed 's/.*/{"cibw-only": "&", "os": "macos-13" }/' | ||
| sed 's/.*/{"cibw-only": "&", "os": "macos-13" }/' \ | ||
&& CIBW_ARCHS_WINDOWS=AMD64 cibuildwheel --print-build-identifiers --platform windows \ | ||
| sed 's/.*/{"cibw-only": "&", "os": "windows-2022", "arch": "AMD64" }/' \ | ||
&& CIBW_ARCHS_WINDOWS=x86 cibuildwheel --print-build-identifiers --platform windows \ | ||
| sed 's/.*/{"cibw-only": "&", "os": "windows-2022", "arch": "x86" }/' | ||
} | jq --slurp --compact-output '{"include": .}' | ||
) | ||
echo matrix="$MATRIX" >> $GITHUB_OUTPUT | ||
build_wheels: | ||
if: false | ||
name: Build ${{ matrix.cibw-only }} wheel | ||
|
||
needs: build_wheels_matrix | ||
|
@@ -124,6 +126,12 @@ jobs: | |
with: | ||
python-version: '3.11' | ||
|
||
- name: Set up MSYS2 | ||
if: runner.os == 'Windows' | ||
uses: ./.github/actions/setup-msys2 | ||
with: | ||
arch: ${{ matrix.arch }} | ||
|
||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v2 | ||
|
@@ -136,62 +144,27 @@ jobs: | |
python -m cibuildwheel --only ${{ matrix.cibw-only }} --print-build-identifiers | ||
- name: Build wheels | ||
if: ${{ (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) || matrix.cibw-only == 'cp310-manylinux_x86_64' }} | ||
if: | | ||
${{ | ||
(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) || | ||
matrix.cibw-only == 'cp310-manylinux_x86_64' || | ||
matrix.cibw-only == 'cp310-win_amd64' || | ||
matrix.cibw-only == 'cp310-win32' | ||
}} | ||
uses: pypa/[email protected] | ||
with: | ||
only: ${{ matrix.cibw-only }} | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: ${{ (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) || matrix.cibw-only == 'cp310-manylinux_x86_64' }} | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
build_wheels_win: | ||
name: Build Windows wheel | ||
|
||
runs-on: windows-2022 | ||
|
||
strategy: | ||
matrix: | ||
arch: ["AMD64", "x86"] | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Set up MSYS2 | ||
uses: ./.github/actions/setup-msys2 | ||
with: | ||
arch: ${{ matrix.arch }} | ||
|
||
- name: Print build identifiers | ||
run: | | ||
python -m pip install cibuildwheel==2.17.0 | ||
python -m cibuildwheel --print-build-identifiers | ||
env: | ||
CIBW_ARCHS: ${{ matrix.arch }} | ||
|
||
- name: Build wheels | ||
if: ${{ (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) }} | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS: ${{ matrix.arch }} | ||
CIBW_ENVIRONMENT: ${{ matrix.arch == 'x86' && 'CC=i686-w64-mingw32-gcc.exe' || '' }} | ||
|
||
- name: Build wheels | ||
if: ${{ !(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) }} | ||
uses: pypa/[email protected] | ||
with: | ||
only: ${{ matrix.arch == 'x86' && 'cp310-win32' || 'cp310-win_amd64' }} | ||
env: | ||
CIBW_ENVIRONMENT: ${{ matrix.arch == 'x86' && 'CC=i686-w64-mingw32-gcc.exe' || '' }} | ||
CIBW_ENVIRONMENT: ${{ runner.os == 'Windows' && matrix.arch == 'x86' && 'CC=i686-w64-mingw32-gcc.exe' || '' }} | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: | | ||
${{ | ||
(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) || | ||
matrix.cibw-only == 'cp310-manylinux_x86_64' || | ||
matrix.cibw-only == 'cp310-win_amd64' || | ||
matrix.cibw-only == 'cp310-win32' | ||
}} | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
|