@@ -36,44 +36,29 @@ concurrency:
3636
3737jobs :
3838 build :
39- name : ${{ matrix.image }} [${{ matrix.arch }}]
40- runs-on : ubuntu-20.04
39+ name : ${{ matrix.arch }}
40+ runs-on : ubuntu-22.04
41+ permissions :
42+ contents : read
43+ packages : write
44+
4145 strategy :
4246 fail-fast : false # if a particular matrix build fails, don't skip the rest
4347 matrix :
44- # Split job into many matrix builds, because GH actions provides 20
45- # concurrent builds on ubuntu. 6 are used here
46- include :
47- # no pypy and cpython >= cp310 on manylinux1
48- - { image: manylinux1, arch: x86_64, pyversions: "cp3[7-9]-*" }
49- - { image: manylinux1, arch: i686, pyversions: "cp3[7-9]-*" }
50-
51- # no pypy >= 3.9 and cpython >= cp311 on manylinux2010
52- - { image: manylinux2010, arch: x86_64, pyversions: "cp3{[7-9],10}-* pp3{7,8}-*" }
53- - { image: manylinux2010, arch: i686, pyversions: "cp3{[7-9],10}-* pp3{7,8}-*" }
54-
55- # all versions of python supported by cibuildwheel (except cp3.6)
56- - { image: manylinux2014, arch: x86_64, pyversions: "cp3{[7-9],10,11}-* pp3{7,8,9}-*" }
57- - { image: manylinux2014, arch: i686, pyversions: "cp3{[7-9],10,11}-* pp3{7,8,9}-*" }
58-
48+ arch : [x86_64, i686]
49+
5950 env :
6051 # load pip config from this file. Define this in 'CIBW_ENVIRONMENT'
6152 # because this should not affect cibuildwheel machinery
6253 # also define environment variables needed for testing
6354 CIBW_ENVIRONMENT : PIP_CONFIG_FILE=buildconfig/pip_config.ini PORTMIDI_INC_PORTTIME=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk
6455
65- CIBW_BUILD : ${{ matrix.pyversions }}
56+ CIBW_BUILD : " cp3{[7-9],10,11}-* pp3[7-9]-* "
6657 CIBW_ARCHS : ${{ matrix.arch }}
6758
6859 # skip musllinux for now
6960 CIBW_SKIP : ' *-musllinux_*'
7061
71- # set custom pygame images
72- CIBW_MANYLINUX_X86_64_IMAGE : pygame/${{ matrix.image }}_base_x86_64
73- CIBW_MANYLINUX_PYPY_X86_64_IMAGE : pygame/${{ matrix.image }}_base_x86_64
74- CIBW_MANYLINUX_I686_IMAGE : pygame/${{ matrix.image }}_base_i686
75- CIBW_MANYLINUX_PYPY_I686_IMAGE : pygame/${{ matrix.image }}_base_i686
76-
7762 # command that runs before every build
7863 CIBW_BEFORE_BUILD : |
7964 pip install Sphinx
9580 steps :
96819782
83+ - name : Log in to the Container registry
84+ uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
85+ with :
86+ registry : ghcr.io
87+ username : ${{ github.actor }}
88+ password : ${{ secrets.GITHUB_TOKEN }}
89+
90+ - name : Inspect image, skip build if image exists
91+ id : inspect
92+ continue-on-error : true
93+ run : docker manifest inspect ghcr.io/${{ github.repository }}_${{ matrix.arch }}:${{ hashFiles('buildconfig/manylinux-build/**') }}
94+
95+ - name : Extract metadata (tags, labels) for Docker
96+ id : meta
97+ uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
98+ with :
99+ images : ghcr.io/${{ github.repository }}_${{ matrix.arch }}
100+ tags : type=raw,value=${{ hashFiles('buildconfig/manylinux-build/**') }}
101+
102+ - name : Build and push Docker image
103+ if : steps.inspect.outcome == 'failure'
104+ uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
105+ with :
106+ context : ${{ github.workspace }}/buildconfig/manylinux-build/docker_base
107+ file : ${{ github.workspace }}/buildconfig/manylinux-build/docker_base/Dockerfile-${{ matrix.arch }}
108+ push : true
109+ tags : ${{ steps.meta.outputs.tags }}
110+ labels : ${{ steps.meta.outputs.labels }}
111+
98112 - name : Build and test wheels
113+ env :
114+ # set custom pygame images
115+ CIBW_MANYLINUX_X86_64_IMAGE : ghcr.io/${{ github.repository }}_x86_64:${{ steps.meta.outputs.version }}
116+ CIBW_MANYLINUX_PYPY_X86_64_IMAGE : ghcr.io/${{ github.repository }}_x86_64:${{ steps.meta.outputs.version }}
117+ CIBW_MANYLINUX_I686_IMAGE : ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}
118+ CIBW_MANYLINUX_PYPY_I686_IMAGE : ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}
119+
99120100121
101122 # We upload the generated files under github actions assets
0 commit comments