Skip to content

Commit

Permalink
fix: improve build matrix for better control
Browse files Browse the repository at this point in the history
- Explicitly define all build combinations
- Add architecture to artifact names
- Improve job naming for better visibility
  • Loading branch information
polischuks committed Jan 31, 2025
1 parent f28114f commit b326b79
Showing 1 changed file with 54 additions and 6 deletions.
60 changes: 54 additions & 6 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,48 @@ on:

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }}
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:
# 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
arch: arm64
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
Expand Down Expand Up @@ -63,8 +92,27 @@ jobs:
run: python -m build --sdist --outdir dist/
shell: bash

- name: Upload to GitHub Release
if: startsWith(github.ref, 'refs/tags/')
- 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/*

0 comments on commit b326b79

Please sign in to comment.