Skip to content

Commit

Permalink
get CIBuildWheel on Mac and Windows CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankith committed Sep 15, 2021
1 parent 450fba8 commit 34be0ff
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 209 deletions.
117 changes: 117 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Build

# Run CI only when a release is created, on changes to main branch, or any PR
# to main. Do not run CI on any other branch. Also, skip any non-source changes
# from running on CI
on:
release:
types: [created]
push:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/manylinux.yml'
- '.github/workflows/sdl1-sdist.yml'

pull_request:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/manylinux.yml'
- '.github/workflows/sdl1-sdist.yml'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
os: [windows-latest, macos-10.15]

# seperate into matrix for concurrency.
pyver: ['cp27', 'cp35', 'cp36', 'cp37', 'cp38', 'cp39', 'cp310', 'pp27', 'pp36', 'pp37']

# exclude py2 builds on windows, because they don't work due to the
# fact that py2 builds use old compiler. There is a workaround for this
# but is not implemented here because Appveyor can already handle py2
# on windows
exclude:
- os: windows-latest
pyver: 'cp27'
- os: windows-latest
pyver: 'pp27'

steps:
- uses: actions/checkout@v2

# use cibuildwheel v1 to build on older python versions
- name: Build wheels with CIBuildWheel v1
if: matrix.pyver == 'cp27' || matrix.pyver == 'cp35' || matrix.pyver == 'pp27' || matrix.pyver == 'pp36'
uses: pypa/cibuildwheel@v1.12.0
env:
SDL_VIDEODRIVER: "dummy"
SDL_AUDIODRIVER: "disk"

CIBW_BUILD: ${{ matrix.pyver }}-*

# Install some dependencies
CIBW_BEFORE_BUILD_MACOS: pip install requests numpy && brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf zlib freetype portmidi
CIBW_BEFORE_BUILD_WINDOWS: pip install requests numpy

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

# Increase pip debugging output
CIBW_BUILD_VERBOSITY: 2

# use latest cibuildwheel for newer python versions
- name: Build wheels with CIBuildWheel v2
if: matrix.pyver != 'cp27' && matrix.pyver != 'cp35' && matrix.pyver != 'pp27' && matrix.pyver != 'pp36'
uses: pypa/cibuildwheel@v2.1.2
env:
SDL_VIDEODRIVER: "dummy"
SDL_AUDIODRIVER: "disk"

CIBW_BUILD: ${{ matrix.pyver }}-*

# Build universal2 wheels too on an Intel runner.
# Note that the `arm64` part of the `universal2` wheel cannot be
# tested in this configuration.
# uncomment when arm builds are working
# CIBW_ARCHS_MACOS: "x86_64 universal2"

# Install some dependencies
CIBW_BEFORE_BUILD_MACOS: pip install requests numpy && brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf zlib freetype portmidi
CIBW_BEFORE_BUILD_WINDOWS: pip install requests numpy

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

# Increase pip debugging output
CIBW_BUILD_VERBOSITY: 2

- uses: actions/upload-artifact@v2
with:
name: pygame-wheels
path: ./wheelhouse/*.whl

# - name: Upload binaries to Github Releases
# if: github.event_name == 'release'
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ./wheelhouse/*.whl
# tag: ${{ github.ref }}
#
# - name: Upload binaries to PyPI
# if: github.event_name == 'release'
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: |
# python3 -m pip install twine
# twine upload ./wheelhouse/*.whl
94 changes: 0 additions & 94 deletions .github/workflows/macos.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ on:
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
- '.github/workflows/build.yml'
- '.github/workflows/sdl1-sdist.yml'

pull_request:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
- '.github/workflows/build.yml'
- '.github/workflows/sdl1-sdist.yml'

jobs:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/sdl1-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ on:
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
- '.github/workflows/build.yml'
- '.github/workflows/manylinux.yml'

pull_request:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
- '.github/workflows/build.yml'
- '.github/workflows/manylinux.yml'

jobs:
Expand Down
105 changes: 0 additions & 105 deletions .github/workflows/windows.yml

This file was deleted.

4 changes: 2 additions & 2 deletions buildconfig/config_darwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ def main(sdl2=False):
print ('Hunting dependencies...')
incdirs = ['/usr/local/include', '/opt/homebrew/include']
if sdl2:
incdirs.extend(['/usr/local/include/SDL2', '/opt/homebrew/include/SDL2'])
incdirs.extend(['/usr/local/include/SDL2', '/opt/homebrew/include/SDL2', '/opt/local/include/SDL2'])
else:
incdirs.extend(['/usr/local/include/SDL', '/opt/homebrew/include/SDL'])
incdirs.extend(['/usr/local/include/SDL', '/opt/homebrew/include/SDL', '/opt/local/include/SDL'])

incdirs.extend([
#'/usr/X11/include',
Expand Down

0 comments on commit 34be0ff

Please sign in to comment.