|
| 1 | +name: Windows |
| 2 | + |
| 3 | +# Run CI only when a release is created, on changes to main branch, or any PR |
| 4 | +# to main. Do not run CI on any other branch. Also, skip any non-source changes |
| 5 | +# from running on CI |
| 6 | +on: |
| 7 | + release: |
| 8 | + types: [created] |
| 9 | + push: |
| 10 | + branches: main |
| 11 | + paths-ignore: |
| 12 | + - 'docs/**' |
| 13 | + - 'examples/**' |
| 14 | + - '.gitignore' |
| 15 | + - '*.rst' |
| 16 | + - '*.md' |
| 17 | + - '.github/workflows/*.yml' |
| 18 | + # re-include current file to not be excluded |
| 19 | + - '!.github/workflows/build-windows.yml' |
| 20 | + |
| 21 | + pull_request: |
| 22 | + branches: main |
| 23 | + paths-ignore: |
| 24 | + - 'docs/**' |
| 25 | + - 'examples/**' |
| 26 | + - '.gitignore' |
| 27 | + - '*.rst' |
| 28 | + - '*.md' |
| 29 | + - '.github/workflows/*.yml' |
| 30 | + # re-include current file to not be excluded |
| 31 | + - '!.github/workflows/build-windows.yml' |
| 32 | + |
| 33 | +jobs: |
| 34 | + build: |
| 35 | + name: ${{ matrix.name }} |
| 36 | + runs-on: windows-latest |
| 37 | + strategy: |
| 38 | + fail-fast: false # if a particular matrix build fails, don't skip the rest |
| 39 | + matrix: |
| 40 | + include: |
| 41 | + - { |
| 42 | + name: "x86_64 (CPython 3.6 3.10 and above)", |
| 43 | + winarch: AMD64, |
| 44 | + msvc-dev-arch: x86_amd64, |
| 45 | + # pattern matches 6 or any 2 digit number |
| 46 | + pyversions: "cp3{6,[1-9][0-9]}-*" |
| 47 | + } |
| 48 | + - { |
| 49 | + name: "CPython 3.11 (64 bit)", |
| 50 | + winarch: AMD64, |
| 51 | + msvc-dev-arch: x86_amd64, |
| 52 | + pyversions: "cp311-*" |
| 53 | + } |
| 54 | + - { |
| 55 | + name: "CPython 3.10 (64 bit)", |
| 56 | + winarch: AMD64, |
| 57 | + msvc-dev-arch: x86_amd64, |
| 58 | + pyversions: "cp310-*" |
| 59 | + } |
| 60 | + - { |
| 61 | + name: "CPython 3.9 (64 bit)", |
| 62 | + winarch: AMD64, |
| 63 | + msvc-dev-arch: x86_amd64, |
| 64 | + pyversions: "cp39-*" |
| 65 | + } |
| 66 | + - { |
| 67 | + name: "CPython 3.8 (64 bit)", |
| 68 | + winarch: AMD64, |
| 69 | + msvc-dev-arch: x86_amd64, |
| 70 | + pyversions: "cp38-*" |
| 71 | + } |
| 72 | + - { |
| 73 | + name: "CPython 3.7 (64 bit)", |
| 74 | + winarch: AMD64, |
| 75 | + msvc-dev-arch: x86_amd64, |
| 76 | + pyversions: "cp37-*" |
| 77 | + } |
| 78 | + - { |
| 79 | + name: "CPython 3.6 (64 bit)", |
| 80 | + winarch: AMD64, |
| 81 | + msvc-dev-arch: x86_amd64, |
| 82 | + pyversions: "cp36-*" |
| 83 | + } |
| 84 | + - { |
| 85 | + name: "CPython 3.11 (32 bit)", |
| 86 | + winarch: x86, |
| 87 | + msvc-dev-arch: x86, |
| 88 | + pyversions: "cp311-win32" |
| 89 | + } |
| 90 | + - { |
| 91 | + name: "CPython 3.10 (32 bit)", |
| 92 | + winarch: x86, |
| 93 | + msvc-dev-arch: x86, |
| 94 | + pyversions: "cp310-win32" |
| 95 | + } |
| 96 | + - { |
| 97 | + name: "CPython 3.9 (32 bit)", |
| 98 | + winarch: x86, |
| 99 | + msvc-dev-arch: x86, |
| 100 | + pyversions: "cp39-win32" |
| 101 | + } |
| 102 | + - { |
| 103 | + name: "CPython 3.8 (32 bit)", |
| 104 | + winarch: x86, |
| 105 | + msvc-dev-arch: x86, |
| 106 | + pyversions: "cp38-win32" |
| 107 | + } |
| 108 | + - { |
| 109 | + name: "CPython 3.7 (32 bit)", |
| 110 | + winarch: x86, |
| 111 | + msvc-dev-arch: x86, |
| 112 | + pyversions: "cp37-win32" |
| 113 | + } |
| 114 | + - { |
| 115 | + name: "CPython 3.6 (32 bit)", |
| 116 | + winarch: x86, |
| 117 | + msvc-dev-arch: x86, |
| 118 | + pyversions: "cp36-win32" |
| 119 | + } |
| 120 | + - { |
| 121 | + name: "Pypy 3.8", |
| 122 | + winarch: AMD64, |
| 123 | + msvc-dev-arch: x86_amd64, |
| 124 | + pyversions: "pp38-*" |
| 125 | + } |
| 126 | + |
| 127 | + |
| 128 | + env: |
| 129 | + # load pip config from this file. Define this in 'CIBW_ENVIRONMENT' |
| 130 | + # because this should not affect cibuildwheel machinery |
| 131 | + # also define environment variables needed for testing |
| 132 | + CIBW_ENVIRONMENT: PIP_CONFIG_FILE=buildconfig/pip_config.ini SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk |
| 133 | + |
| 134 | + CIBW_BUILD: ${{ matrix.pyversions }} |
| 135 | + CIBW_ARCHS: ${{ matrix.winarch }} |
| 136 | + |
| 137 | +# Not sure if we can use this later. I had to move the docs into the steps section for it |
| 138 | +# to be included in the wheel |
| 139 | +# CIBW_BEFORE_BUILD: | |
| 140 | +# call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 |
| 141 | +# set DISTUTILS_USE_SDK=1 |
| 142 | +# set MSSdk=1 |
| 143 | +# pip install setuptools wheel requests numpy Sphinx |
| 144 | +# python setup.py docs |
| 145 | + CIBW_TEST_COMMAND: python -m pygame.tests -v --exclude opengl,timing --time_out 300 |
| 146 | + |
| 147 | + # Increase pip debugging output |
| 148 | + CIBW_BUILD_VERBOSITY: 2 |
| 149 | + |
| 150 | + steps: |
| 151 | + - uses: actions/checkout@v3.0.2 |
| 152 | + |
| 153 | + - uses: TheMrMilchmann/setup-msvc-dev@v2 # this lets us use the developer command prompt on windows |
| 154 | + with: |
| 155 | + arch: ${{ matrix.msvc-dev-arch }} |
| 156 | + - name: Build and test wheels |
| 157 | + shell: cmd |
| 158 | + run: | |
| 159 | + set DISTUTILS_USE_SDK=1 |
| 160 | + set MSSdk=1 |
| 161 | + python -m pip install setuptools wheel requests numpy Sphinx |
| 162 | + python setup.py docs |
| 163 | + python -m pip --disable-pip-version-check install cibuildwheel |
| 164 | + python -m cibuildwheel --output-dir wheelhouse |
| 165 | +
|
| 166 | + - uses: actions/upload-artifact@v3 |
| 167 | + with: |
| 168 | + name: pygame-wheels |
| 169 | + path: ./wheelhouse/*.whl |
0 commit comments