Cross compile for x86_64 macs on arm macs, bump some mac/manylinux deps #5928
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ManyLinux | |
| # Run CI only when a release is created, on changes to main branch, or any PR | |
| # to main. | |
| on: | |
| push: | |
| branches: main | |
| pull_request: | |
| branches: main | |
| # the github release drafter can call this workflow | |
| workflow_call: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-manylinux | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: ${{ matrix.arch }} | |
| runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false # if a particular matrix build fails, don't skip the rest | |
| matrix: | |
| arch: [x86_64, i686, aarch64] | |
| env: | |
| CIBW_ARCHS: ${{ matrix.arch }} | |
| steps: | |
| - uses: actions/[email protected] | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Inspect image, skip build if image exists | |
| id: inspect | |
| continue-on-error: true | |
| run: docker manifest inspect ghcr.io/${{ github.repository }}_${{ matrix.arch }}:${{ hashFiles('buildconfig/manylinux-build/**') }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f | |
| with: | |
| images: ghcr.io/${{ github.repository }}_${{ matrix.arch }} | |
| tags: type=raw,value=${{ hashFiles('buildconfig/manylinux-build/**') }} | |
| - name: Build and push Docker image | |
| if: steps.inspect.outcome == 'failure' | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 | |
| with: | |
| context: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base | |
| file: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base/Dockerfile-${{ matrix.arch }} | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: Build and test wheels | |
| env: | |
| # set custom pygame images | |
| CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/${{ github.repository }}_x86_64:${{ steps.meta.outputs.version }} | |
| CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ghcr.io/${{ github.repository }}_x86_64:${{ steps.meta.outputs.version }} | |
| CIBW_MANYLINUX_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }} | |
| CIBW_MANYLINUX_PYPY_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }} | |
| CIBW_MANYLINUX_AARCH64_IMAGE: ghcr.io/${{ github.repository }}_aarch64:${{ steps.meta.outputs.version }} | |
| CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: ghcr.io/${{ github.repository }}_aarch64:${{ steps.meta.outputs.version }} | |
| uses: pypa/[email protected] | |
| # We upload the generated files under github actions assets | |
| - name: Upload dist | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pygame-wheels-manylinux-${{ matrix.arch }} | |
| path: ./wheelhouse/*.whl | |
| compression-level: 0 # wheels are already zip files, no need for more compression |