forked from pypa/manylinux
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (98 loc) · 3.45 KB
/
build.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
103
104
105
106
107
108
109
name: Build
on:
workflow_dispatch:
push:
branches-ignore:
- "update-dependencies-pr"
tags:
- 'v*'
paths:
- ".github/workflows/build.yml"
- "docker/**"
- "*.sh"
pull_request:
paths:
- ".github/workflows/build.yml"
- "docker/**"
- "build.sh"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
build_manylinux:
name: ${{ matrix.policy[0] }}
runs-on: ${{ matrix.policy[6] }}
strategy:
fail-fast: false
matrix:
# 0. policy
# 1. base image
# 2. DEVTOOLSET_ROOTPATH
# 3. PREPEND_PATH
# 4. LD_LIBRARY_PATH_ARG
# 5. Docker platforms
# 6. Github Action runner
policy: [
["manylinux2014", "centos:7",
"/opt/rh/devtoolset-10/root", "/opt/rh/devtoolset-10/root/usr/bin:",
"/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/usr/local/lib64",
"linux/amd64,linux/arm64,linux/ppc64le", self-hosted
],
["manylinux_2_28", "almalinux:8",
"/opt/rh/gcc-toolset-12/root",
"/opt/rh/gcc-toolset-12/root/usr/bin:",
"/opt/rh/gcc-toolset-12/root/usr/lib64:/opt/rh/gcc-toolset-12/root/usr/lib:/opt/rh/gcc-toolset-12/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-12/root/usr/lib/dyninst",
'linux/amd64,linux/arm64', ubuntu-latest],
["musllinux_1_1", "alpine:3.12", "", "", "", 'linux/amd64', ubuntu-latest],
["musllinux_1_2", "alpine:3.18", "", "", "", 'linux/amd64', ubuntu-latest]
]
env:
POLICY: ${{ matrix.policy[0] }}
BASEIMAGE: ${{ matrix.policy[1] }}
DEVTOOLSET_ROOTPATH: ${{ matrix.policy[2] }}
PREPEND_PATH: ${{ matrix.policy[3] }}
LD_LIBRARY_PATH_ARG: ${{ matrix.policy[4] }}
COMMIT_SHA: ${{ github.sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
# Setup tags to be used for docker images
- uses: docker/metadata-action@v5
id: docker_meta
with:
images: ghcr.io/${{ github.repository_owner }}/${{ matrix.policy[0] }}
- name: Set up emulation
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.policy[5] }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Deploy
uses: docker/build-push-action@v5
with:
context: docker
push: ${{ github.event_name == 'push' }}
build-args: |
POLICY
BASEIMAGE
DEVTOOLSET_ROOTPATH
PREPEND_PATH
LD_LIBRARY_PATH_ARG
platforms: ${{ matrix.policy[5] }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
# See: https://github.com/moby/buildkit#github-actions-cache-experimental
cache-from: |
${{ steps.meta.outputs.tags }}
cache-to: type=inline
all_passed:
needs: [build_manylinux]
runs-on: ubuntu-latest
steps:
- run: echo "All jobs passed"