Skip to content

fix: correct pip wheel command syntax #5

fix: correct pip wheel command syntax

fix: correct pip wheel command syntax #5

Workflow file for this run

name: Build Wheels
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12']
include:
- os: macos-latest
arch: arm64
- os: macos-latest
arch: x86_64
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build tools
run: |
python -m pip install build poetry
- name: Build wheel with dependencies
run: |
# Install dependencies first to ensure they're available
poetry install
# Build wheel including all dependencies
python -m pip wheel . -w dist/
# On macOS, repair wheels and build for arm64 if needed
if [ "${{ runner.os }}" = "macOS" ]; then
pip install delocate
if [ "${{ matrix.arch }}" = "arm64" ]; then
# Set environment for arm64 build
export ARCHFLAGS="-arch arm64"
export _PYTHON_HOST_PLATFORM="macosx-11.0-arm64"
fi
delocate-wheel -w dist/fixed -v dist/*.whl
mv dist/fixed/* dist/
rm -rf dist/fixed
fi
shell: bash
- name: Build source distribution
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
run: python -m build --sdist --outdir dist/
- name: Upload to GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: dist/*