From d6519730106d30cb1eb75df7849b5131c8ca1130 Mon Sep 17 00:00:00 2001 From: Laky64 Date: Fri, 1 Mar 2024 00:44:19 +0100 Subject: [PATCH] Fixed Github Action --- .github/cibuildwheel/action.yml | 34 +++++++++++++++++++++++++++++++++ .github/workflows/build.yml | 28 ++++++++++++++++++++------- 2 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 .github/cibuildwheel/action.yml diff --git a/.github/cibuildwheel/action.yml b/.github/cibuildwheel/action.yml new file mode 100644 index 00000000..97458e43 --- /dev/null +++ b/.github/cibuildwheel/action.yml @@ -0,0 +1,34 @@ +name: cibuildwheel +description: 'Installs and runs cibuildwheel on the current runner' +inputs: + python-path: + description: 'Path to the Python interpreter to use' + required: false + default: '' + +branding: + icon: package + color: yellow + +runs: + using: composite + steps: + - run: > + "${{ inputs.python-path }}" -m pipx run + --spec '${{ github.action_path }}' + cibuildwheel . + --output-dir "wheelhouse" + 2>&1 + shell: bash + if: runner.os != 'Windows' + + - run: > + if ($PSNativeCommandArgumentPassing) { + $PSNativeCommandArgumentPassing = 'Legacy' + }; + & "${{ inputs.python-path }}" -m pipx run + --spec "${{ github.action_path }}" + cibuildwheel . + --output-dir '"wheelhouse"' + shell: pwsh + if: runner.os == 'Windows' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27b90233..93e8b710 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,6 @@ jobs: cibw_archs: "arm64" cibw_os_build: "macosx_arm64" shared_name: "macos-arm64" - fail-fast: false steps: - name: Check out the repo @@ -41,17 +40,29 @@ jobs: with: submodules: recursive + - name: Set up Python + uses: actions/setup-python@v5 + if: matrix.cibw_archs != 'aarch64' + id: python + with: + python-version: "3.8 - 3.12" + update-environment: false + + - name: Set up Python (ARM64) + if: matrix.cibw_archs == 'aarch64' + run: echo "::set-output name=python-path::python3.12" + + - name: Install Python Requirements + run: | + "${{ steps.python.outputs.python-path }}" -m pip install setuptools + "${{ steps.python.outputs.python-path }}" -m pip install pipx + - name: Set up QEMU if: matrix.cibw_archs == 'aarch64' uses: docker/setup-qemu-action@v3 with: platforms: arm64 - - name: Install SetupTools - if: matrix.cibw_os_build == 'macosx_arm64' - run: | - pip install setuptools - - name: Build Debug Shared lib if: matrix.cibw_archs != 'aarch64' run: python3 setup.py build_shared --no-preserve-cache --debug @@ -83,7 +94,10 @@ jobs: if-no-files-found: error - name: Build wheels - uses: pypa/cibuildwheel@v2.16.5 + uses: ./.github/cibuildwheel + with: + python-path: ${{ steps.python.outputs.python-path }} + env: CIBW_ARCHS: ${{ matrix.cibw_archs }} CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"