forked from tianon/docker-brew-debian
-
Notifications
You must be signed in to change notification settings - Fork 1
167 lines (154 loc) · 6.57 KB
/
ci.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Container Images
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
inputs:
include_eol:
description: 'Build also EOL-ed suites'
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
INCLUDE_EOL: ${{ inputs.include_eol && 'true' || '' }}
jobs:
matrix:
name: Build Matrix
runs-on: ubuntu-latest
outputs:
full_json: ${{ steps.releases.outputs.json }}
codenames: ${{ steps.pp.outputs.codenames }}
codename_arch: ${{ steps.pp.outputs.codename_arch }}
steps:
- name: Releases Info
id: releases
uses: vicamo/actions-library/debian-releases@v1
- name: Post Processing
id: pp
env:
FULL_JSON: ${{ steps.releases.outputs.json }}
run: |
platforms='[
["amd64", "linux/amd64"],
["arm", "linux/arm"],
["arm64", "linux/arm64/v8"],
["armel", "linux/arm/v5"],
["armhf", "linux/arm/v7"],
["i386", "linux/386"],
["loong64", "linux/loong64"],
["mips64el", "linux/mips64le"],
["ppc64el", "linux/ppc64le"],
["riscv64", "linux/riscv64"],
["s390x", "linux/s390x"],
["mips", "linux/mips"],
["mipsel", "linux/mipsle"],
["powerpc", "linux/ppc"],
["ppc64", "linux/ppc64"],
["s390", "linux/s390"],
["sparc", "linux/sparc"],
["sparc64", "linux/sparc64"],
["x32", "linux/amd64p32"],
["alpha", "linux/alpha"],
["hppa", "linux/hppa"],
["m68k", "linux/m68k"],
["sh4", "linux/sh4"]
]'
disabled_codename='["experimental"]'
disabled_arches='["hurd-amd64", "hurd-i386", "ia64", "kfreebsd-amd64", "kfreebsd-i386", "s390", "x32"]'
known_failures='[
["sid", "loong64", "https://github.com/vicamo/docker-brew-debian/issues/52"]
]'
pin_timestamp='[
["buster", "armel", "2024/04/13 14:49:39"],
["buster", "mips", "2024/04/13 14:49:39"],
["buster", "mips64el", "2024/04/13 14:49:39"],
["buster", "mipsel", "2024/04/13 14:49:39"],
["buster", "ppc64el", "2024/04/13 14:49:39"],
["buster", "s390x", "2024/04/13 14:49:39"]
]'
pin_qemu='[
["any", "alpha", "ubuntu"],
["any", "hppa", "ubuntu"],
["any", "m68k", "ubuntu"],
["any", "mips", "ubuntu"],
["any", "mipsel", "ubuntu"],
["any", "powerpc", "ubuntu"],
["any", "ppc64", "ubuntu"],
["any", "sh4", "ubuntu"],
["any", "sparc", "ubuntu"],
["any", "sparc64", "ubuntu"]
]'
codenames="$(echo "${FULL_JSON}" |
jq -c -M 'map(select(.codename as $c |
'"${disabled_codename}"' |
index($c) == null)) |
map(. as $s |
$s.mirrors[0].pockets[$s.codename].architectures as $da |
$s |
{
"distribution":.distribution,
"codename":.codename,
"suite":.suite,
"active":.active,
"architectures":(.architectures - '"${disabled_arches}"' |
map({
"arch":.,
"platform":(. as $arch |
'"${platforms}"' |
map(select(.[0] == $arch))[0][1]),
"use_ports":(. as $arch |
$da |
index($arch) == null),
"known_failure":(. as $arch |
'"${known_failures}"' |
map(select((.[0] == $s.codename) and (.[1] == $arch)) | .[2]) |
first),
"timestamp":(. as $arch |
'"${pin_timestamp}"' |
map(select((.[0] == $s.codename) and (.[1] == $arch)) | .[2]) |
first),
"qemu":(. as $arch |
'"${pin_qemu}"' |
map(select(((.[0] == $s.codename) and (.[1] == $arch))
or ((.[0] == "any") and (.[1] == $arch))
or ((.[0] == $s.codename) and (.[1] == "any"))) | .[2]) |
first),
}) |
tostring)
})')"
if [ -z "${INCLUDE_EOL}" ]; then
codenames="$(echo "${codenames}" | jq -c -M 'map(select(.active))')"
fi
echo "::group::Built JSON(codenames)"
echo "${codenames}" | jq
echo "::endgroup::"
echo "codenames=${codenames}" | tee -a "${GITHUB_OUTPUT}"
per-suite:
name: Per Suite
needs:
- matrix
strategy:
fail-fast: false
max-parallel: 1
matrix:
include: ${{ fromJSON(needs.matrix.outputs.codenames) }}
uses: ./.github/workflows/per-suite.yml
secrets:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
with:
distribution: ${{ matrix.distribution }}
codename: ${{ matrix.codename }}
suite: ${{ matrix.suite }}
active: ${{ matrix.active }}
architectures: ${{ matrix.architectures }}
repository: 'vicamo/debian'
dry_run: ${{ github.ref_name != 'main' }}