-
-
Notifications
You must be signed in to change notification settings - Fork 30
133 lines (126 loc) · 3.81 KB
/
build-manylinux-container-images.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
---
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: ubuntu-latest
strategy:
matrix:
IMAGE:
# Build containers for x86_64
- ARCH: x86_64
QEMU_ARCH: amd64
# Build containers for aarch64 (ARM 64)
- ARCH: aarch64
QEMU_ARCH: arm64
# Build containers for ppc64le
- ARCH: ppc64le
# Build containers for s390x
- ARCH: s390x
# There are no base containers for these archs
# at https://quay.io/organization/pypa.
# Build containers for armv7l (ARM v7)
# - ARCH: armv7l
# QEMU_ARCH: arm/v7
# Build containers for ppc64
# - ARCH: ppc64
YEAR:
- 2014
- _2_24 # PEP 600
- _2_28
include:
- IMAGE:
ARCH: x86_64
QEMU_ARCH: amd64
YEAR: 1
- IMAGE:
ARCH: x86_64
QEMU_ARCH: amd64
YEAR: 2010
env:
LIBSSH_VERSION: 0.9.6
PYPA_MANYLINUX_TAG: >-
manylinux${{ matrix.YEAR }}_${{ matrix.IMAGE.ARCH }}
FULL_IMAGE_NAME: >-
${{
github.repository
}}-manylinux${{
matrix.YEAR
}}_${{
matrix.IMAGE.ARCH
}}
QEMU_ARCH: ${{ matrix.IMAGE.QEMU_ARCH || matrix.IMAGE.ARCH }}
defaults:
run:
working-directory: build-scripts/manylinux-container-image/
name: >- # can't use `env` in this context:
🐳
manylinux${{ matrix.YEAR }}_${{ matrix.IMAGE.ARCH }}
steps:
- name: Fetch the repo src
uses: actions/[email protected]
- name: >-
Set up QEMU ${{ env.QEMU_ARCH }} arch emulation
with Podman
if: env.QEMU_ARCH != 'amd64'
run: >-
sudo podman run
--rm --privileged
multiarch/qemu-user-static
--reset -p yes
- name: Build the image with Buildah
id: build-image
uses: redhat-actions/[email protected]
with:
arch: linux/${{ 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/[email protected]
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 }}'
...