Fixes compatibility with PowerShell 7.3 on Windows through GitHub Actions when one of the options for cibuildwheel is empty.
66 lines
2.0 KiB
YAML
66 lines
2.0 KiB
YAML
name: cibuildwheel
|
|
description: 'Installs and runs cibuildwheel on the current runner'
|
|
inputs:
|
|
package-dir:
|
|
description: 'Input directory, defaults to "."'
|
|
required: false
|
|
default: .
|
|
output-dir:
|
|
description: 'Folder to place the outputs in, defaults to "wheelhouse"'
|
|
required: false
|
|
default: wheelhouse
|
|
config-file:
|
|
description: 'File containing the config, defaults to {package}/pyproject.toml'
|
|
required: false
|
|
default: ''
|
|
only:
|
|
description: 'Build a specific wheel only. No need for arch/platform if this is set'
|
|
required: false
|
|
default: ''
|
|
branding:
|
|
icon: package
|
|
color: yellow
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
# Set up a non-EOL, cibuildwheel & pipx supported Python version
|
|
- uses: actions/setup-python@v5
|
|
id: python
|
|
with:
|
|
python-version: "3.8 - 3.12"
|
|
update-environment: false
|
|
|
|
# Redirecting stderr to stdout to fix interleaving issue in Actions.
|
|
- run: >
|
|
pipx run
|
|
--python '${{ steps.python.outputs.python-path }}'
|
|
--spec '${{ github.action_path }}'
|
|
cibuildwheel
|
|
"${{ inputs.package-dir }}"
|
|
--output-dir "${{ inputs.output-dir }}"
|
|
--config-file "${{ inputs.config-file }}"
|
|
--only "${{ inputs.only }}"
|
|
2>&1
|
|
shell: bash
|
|
if: runner.os != 'Windows'
|
|
|
|
# Windows needs powershell to interact nicely with Meson
|
|
# $PSNativeCommandArgumentPassing was introduced in pwsh 7.3 and the
|
|
# legacy behaviour is needed for backwards compatibility with how this
|
|
# was called in the past.
|
|
- run: >
|
|
if ($PSNativeCommandArgumentPassing) {
|
|
$PSNativeCommandArgumentPassing = 'Legacy'
|
|
};
|
|
pipx run
|
|
--python "${{ steps.python.outputs.python-path }}"
|
|
--spec "${{ github.action_path }}"
|
|
cibuildwheel
|
|
"${{ inputs.package-dir }}"
|
|
--output-dir '"${{ inputs.output-dir }}"'
|
|
--config-file '"${{ inputs.config-file }}"'
|
|
--only '"${{ inputs.only }}"'
|
|
shell: pwsh
|
|
if: runner.os == 'Windows'
|