-
-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathbuild-manylinux-container-images.yml
More file actions
142 lines (131 loc) · 3.99 KB
/
Copy pathbuild-manylinux-container-images.yml
File metadata and controls
142 lines (131 loc) · 3.99 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
name: ♲ manylinux containers
on: # yamllint disable-line rule:truthy
workflow_dispatch:
schedule:
# Run once a week on Mondays
- cron: 0 0 * * MON
pull_request:
paths:
- .github/workflows/build-manylinux-container-images.yml
- build-scripts/manylinux-container-image/**
push:
branches:
- devel
paths:
- .github/workflows/build-manylinux-container-images.yml
- build-scripts/manylinux-container-image/**
jobs:
build:
runs-on: ${{ matrix.IMAGE.HOST_OS || 'ubuntu-latest' }}
timeout-minutes: 50
strategy:
matrix:
# All cached images we prebuild now target PEP 600 tags only
IMAGE:
# Build containers for x86_64
- ARCH: x86_64
QEMU_ARCH: amd64
# Build containers for aarch64 (ARM 64)
- ARCH: aarch64
HOST_OS: ubuntu-24.04-arm
# Build containers for ppc64le
- ARCH: ppc64le
# Build containers for s390x
- ARCH: s390x
YEAR:
- _2_24
- _2_28
- _2_34
include:
- IMAGE:
ARCH_SUFFIX: armv7l
ARCH: arm
HOST_OS: ubuntu-24.04-arm
YEAR: _2_31 # There are no base images prior to 2.31 for this arch
env:
LIBSSH_VERSION: 0.12.0
PYPA_MANYLINUX_TAG: >-
manylinux${{ matrix.YEAR }}_${{
matrix.IMAGE.ARCH_SUFFIX
|| matrix.IMAGE.ARCH
}}
FULL_IMAGE_NAME: >-
${{
github.repository
}}-manylinux${{
matrix.YEAR
}}_${{
matrix.IMAGE.ARCH_SUFFIX
|| matrix.IMAGE.ARCH
}}
QEMU_ARCH: ${{ matrix.IMAGE.QEMU_ARCH || matrix.IMAGE.ARCH }}
defaults:
run:
shell: bash -eEuxo pipefail {0}
working-directory: build-scripts/manylinux-container-image/
name: >- # can't use `env` in this context:
🐳
manylinux${{ matrix.YEAR }}_${{
matrix.IMAGE.ARCH_SUFFIX
|| matrix.IMAGE.ARCH
}}
steps:
- name: Fetch the repo src
uses: actions/checkout@v6
- name: >-
Set up QEMU ${{ env.QEMU_ARCH }} arch emulation
with Podman
if: >-
!contains(fromJSON('["aarch64", "amd64", "arm"]'), env.QEMU_ARCH)
run: >
sudo podman run
--rm --privileged
tonistiigi/binfmt
--uninstall 'qemu-*'
sudo podman run
--rm --privileged
tonistiigi/binfmt
--install all
- name: Build the image with Buildah
id: build-image
uses: redhat-actions/buildah-build@v2.13
with:
arch: ${{ env.QEMU_ARCH }}
image: ${{ env.FULL_IMAGE_NAME }}
tags: >-
${{ github.sha }}
libssh-v${{ env.LIBSSH_VERSION }}_gh-${{ github.sha }}
libssh-v${{ env.LIBSSH_VERSION }}
latest
dockerfiles: build-scripts/manylinux-container-image/Dockerfile
context: build-scripts/manylinux-container-image/
oci: true # Should be alright because we don't publish to Docker Hub
build-args: |
LIBSSH_VERSION=${{ env.LIBSSH_VERSION }}
RELEASE=${{ env.PYPA_MANYLINUX_TAG }}
- name: Push to GitHub Container Registry
if: >-
(github.event_name == 'push' || github.event_name == 'schedule')
&& github.ref == format(
'refs/heads/{0}', github.event.repository.default_branch
)
id: push-to-ghcr
uses: redhat-actions/push-to-registry@v2.8
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log the upload result
if: >-
(github.event_name == 'push' || github.event_name == 'schedule')
&& github.ref == format(
'refs/heads/{0}', github.event.repository.default_branch
)
run: >-
echo
'New image has been pushed to
${{ steps.push-to-ghcr.outputs.registry-paths }}'
...