Skip to content

Commit

Permalink
TEMP COMMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
ankith26 committed Apr 13, 2024
1 parent aef3b09 commit 759d75d
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 958 deletions.
93 changes: 0 additions & 93 deletions .github/workflows/build-debian-multiarch.yml

This file was deleted.

95 changes: 0 additions & 95 deletions .github/workflows/build-emsdk.yml

This file was deleted.

123 changes: 6 additions & 117 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
steps:
- uses: actions/checkout@v4.1.2

- run: find / -name "*freetype*dylib" 2>/dev/null

- name: Test for Mac Deps cache hit
id: macdep-cache
uses: actions/cache@v4.0.2
Expand All @@ -59,134 +61,21 @@ jobs:
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}-${{ matrix.runner }}
lookup-only: true

- run: find / -name "*freetype*dylib" 2>/dev/null

# build mac deps on cache miss
- name: Build Mac Deps
if: steps.macdep-cache.outputs.cache-hit != 'true'
run: |
export MAC_ARCH="${{ matrix.macarch }}"
brew install coreutils pkg-config
cd buildconfig/macdependencies
bash ./build_mac_deps.sh
- run: find / -name "*freetype*dylib" 2>/dev/null

# Uncomment when you want to manually verify the deps by downloading them
# - name: Upload Mac deps
# uses: actions/upload-artifact@v4
# with:
# name: pygame-mac-deps-${{ matrix.macarch }}
# path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}

build:
name: ${{ matrix.name }}
needs: deps
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
# Split job into 5 matrix builds, because GH actions provides 5 concurrent
# builds on macOS. This needs to be manually kept updated so that each
# of these builds take roughly the same time
include:
- {
name: "x86_64 (CPython 3.9 - 3.12)",
macarch: x86_64,
runner: macos-13,
pyversions: "cp3{9,10,11,12}-*",
}

- {
name: "x86_64 (Python 3.8)",
macarch: x86_64,
runner: macos-13,
# CPython/PyPy 3.8
pyversions: "?p38-*",
}

- {
name: "x86_64 (PyPy 3.9 and 3.10)",
macarch: x86_64,
runner: macos-13,
pyversions: "pp39-* pp310-*",
}

- {
name: "arm64 (CPython 3.8 - 3.10)",
macarch: arm64,
runner: macos-14,
pyversions: "cp3{8,9,10}-*",
}

- {
name: "arm64 (CPython 3.11 - 3.12)",
macarch: arm64,
runner: macos-14,
pyversions: "cp3{11,12}-*",
}

env:
MAC_ARCH: ${{ matrix.macarch }}
# load pip config from this file. Define this in 'CIBW_ENVIRONMENT'
# because this should not affect cibuildwheel machinery
# also define environment variables needed for testing
CIBW_ENVIRONMENT: SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk

# Explicitly tell CIBW what the wheel arch deployment target should be
# There seems to be no better way to set this than this env
# We need this because our minimum is 10.11, different from default
# of 10.9 on x86s
# Related issue: https://github.com/pypa/cibuildwheel/issues/952
_PYTHON_HOST_PLATFORM: ${{ matrix.macarch == 'x86_64' && 'macosx-10.11-x86_64' || 'macosx-11.0-arm64'}}

# Similarly, we need to tell CIBW that the wheel's linking steps
# should be for 10.11 on x86
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macarch == 'x86_64' && '10.11' || '11.0' }}

CIBW_BUILD: ${{ matrix.pyversions }}

CIBW_ARCHS: ${{ matrix.macarch }}

# Setup macOS dependencies
CIBW_BEFORE_ALL: |
brew install pkg-config
cd buildconfig/macdependencies
cp -r ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }} ${{ github.workspace }}/pygame_mac_deps
bash ./install_mac_deps.sh
CIBW_BEFORE_BUILD: |
pip install numpy Sphinx"<7.2.0"
python setup.py docs
cp -r ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }} ${{ github.workspace }}/pygame_mac_deps
# To remove any speculations about the wheel not being self-contained
CIBW_BEFORE_TEST: rm -rf ${{ github.workspace }}/pygame_mac_deps

CIBW_TEST_COMMAND: python -m pygame.tests -v --exclude opengl,timing --time_out 300

# Increase pip debugging output
CIBW_BUILD_VERBOSITY: 2

steps:
- uses: actions/checkout@v4.1.2

- name: pip cache
uses: actions/cache@v4.0.2
with:
path: ~/Library/Caches/pip # This cache path is only right on mac
key: pip-cache-${{ matrix.name }}

- name: Fetch Mac deps
id: macdep-cache
uses: actions/cache@v4.0.2
with:
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
fail-on-cache-miss: true

- name: Build and test wheels
uses: pypa/cibuildwheel@v2.17.0

- uses: actions/upload-artifact@v4
with:
name: pygame-wheels-macos-${{ matrix.name }}
path: ./wheelhouse/*.whl
compression-level: 0 # wheels are already zip files, no need for more compression

Loading

0 comments on commit 759d75d

Please sign in to comment.