Skip to content

feat: build single wheel with all dependencies included #8

feat: build single wheel with all dependencies included

feat: build single wheel with all dependencies included #8

Workflow file for this run

name: Build Wheels
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
include:
# Linux builds
- os: ubuntu-latest
python-version: '3.10'
- os: ubuntu-latest
python-version: '3.11'
- os: ubuntu-latest
python-version: '3.12'
# Windows builds
- os: windows-latest
python-version: '3.10'
- os: windows-latest
python-version: '3.11'
- os: windows-latest
python-version: '3.12'
# macOS builds
- os: macos-latest
python-version: '3.10'
arch: x86_64
- os: macos-latest
python-version: '3.11'
arch: x86_64
- os: macos-latest
python-version: '3.12'
arch: x86_64
- os: macos-latest
python-version: '3.10'
arch: arm64
- os: macos-latest
python-version: '3.11'
arch: arm64
- os: macos-latest
python-version: '3.12'
arch: arm64
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
shell: bash
- name: Build wheel with dependencies
run: |
# Install dependencies first to ensure they're available
poetry install --all-extras
# Build wheel including all dependencies
python -m pip wheel . -w dist/
shell: bash
- name: Repair macOS wheels
if: runner.os == 'macOS'
run: |
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
shell: bash
- name: Build source distribution
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
run: python -m build --sdist --outdir dist/
shell: bash
- name: Upload to GitHub Actions
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.arch }}-py${{ matrix.python-version }}
path: dist/*
release:
needs: build_wheels
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: dist-*
path: dist
merge-multiple: true
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: dist/*