-
-
Notifications
You must be signed in to change notification settings - Fork 152
102 lines (87 loc) · 3.36 KB
/
build-manylinux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: ManyLinux
# 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:
push:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- '*.rst'
- '*.md'
- '.github/workflows/*.yml'
# re-include current file to not be excluded
- '!.github/workflows/build-manylinux.yml'
pull_request:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- '*.rst'
- '*.md'
- '.github/workflows/*.yml'
# re-include current file to not be excluded
- '!.github/workflows/build-manylinux.yml'
# 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: 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]
env:
CIBW_ARCHS: ${{ matrix.arch }}
steps:
- uses: actions/[email protected]
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
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@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
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@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
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 }}
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