From b326b79bfaadd4decef0ecbd02cba846266b738a Mon Sep 17 00:00:00 2001 From: polishchuks Date: Fri, 31 Jan 2025 12:37:17 +0200 Subject: [PATCH] fix: improve build matrix for better control - Explicitly define all build combinations - Add architecture to artifact names - Improve job naming for better visibility --- .github/workflows/build-wheels.yml | 60 +++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 3f25a72..a1bc0d1 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -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 @@ -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/*