@@ -25,10 +25,10 @@ env: # Global environment, passed to all jobs & all steps
25
25
CI_TAGS : " standard armbian-sbc armbian-uefi lts" # 'dev' is not included
26
26
27
27
# GHA runner configuration. See bash/json-matrix.sh for more details.
28
- CI_RUNNER_LK_CONTAINERS_ARM64 : " oracle-24cpu-384gb -arm64" # Use a self-hosted runner with the "ARM64" tag for the ARM64 builds of LK containers
29
- CI_RUNNER_LK_CONTAINERS_AMD64 : " oracle-24cpu-384gb -x86-64" # Use a self-hosted runner with the "X86" tag for the AMD64 builds of LK containers
30
- CI_RUNNER_LK_ARM64 : " oracle-24cpu-384gb -arm64" # Use a self-hosted runner with the "ARM64" tag for the ARM64 linuxkit builds
31
- CI_RUNNER_LK_AMD64 : " oracle-24cpu-384gb -x86-64" # Use a self-hosted runner with the "X86" tag for the AMD64 linuxkit builds
28
+ CI_RUNNER_LK_CONTAINERS_ARM64 : " oracle-vm-32cpu-128gb -arm64" # Use a self-hosted runner with the "ARM64" tag for the ARM64 builds of LK containers
29
+ CI_RUNNER_LK_CONTAINERS_AMD64 : " oracle-vm-32cpu-128gb -x86-64" # Use a self-hosted runner with the "X86" tag for the AMD64 builds of LK containers
30
+ CI_RUNNER_LK_ARM64 : " oracle-vm-32cpu-128gb -arm64" # Use a self-hosted runner with the "ARM64" tag for the ARM64 linuxkit builds
31
+ CI_RUNNER_LK_AMD64 : " oracle-vm-32cpu-128gb -x86-64" # Use a self-hosted runner with the "X86" tag for the AMD64 linuxkit builds
32
32
CI_RUNNER_KERNEL_AMD64 : " oracle-24cpu-384gb-x86-64" # Use a self-hosted runner with the "X86" tag for the AMD64 kernel builds
33
33
CI_RUNNER_KERNEL_ARM64 : " oracle-24cpu-384gb-arm64" # Use a self-hosted runner with the "ARM64" tag for the ARM64 kernel builds
34
34
45
45
lk_hooks_json : ${{ steps.prepare-matrix.outputs.lk_hooks_json }}
46
46
steps :
47
47
- name : Checkout repo
48
- uses : actions/checkout@v4
48
+ uses : actions/checkout@v5
49
49
50
50
- name : Prepare release ID (current date) # This only used for the GitHub Release; not included in any way in the build process.
51
51
id : date_prep
@@ -60,21 +60,27 @@ jobs:
60
60
61
61
build-linuxkit-containers :
62
62
needs : [ matrix_prep ]
63
- runs-on : " ${{ matrix.runner }}" # the runner to use is determined by the 'gha-matrix' code
63
+ runs-on :
64
+ group : Default
65
+ labels : " ${{ matrix.runner }}" # the runner to use is determined by the 'gha-matrix' code
64
66
strategy :
65
67
fail-fast : true
66
68
matrix :
67
69
include : ${{ fromJSON(needs.matrix_prep.outputs.lkcontainers_json) }}
68
70
name : " LinuxKit containers for ${{ matrix.docker_arch }}"
69
71
steps :
70
72
- name : Checkout build repo
71
- uses : actions/checkout@v4
73
+ uses : actions/checkout@v5
72
74
73
75
- name : Set up QEMU
74
76
uses : docker/setup-qemu-action@v3
75
77
76
78
- name : Set up Docker Buildx
77
79
uses : docker/setup-buildx-action@v3
80
+ with :
81
+ buildkitd-config-inline : |
82
+ [registry."docker.io"]
83
+ mirrors = ["mirror.gcr.io"]
78
84
79
85
- name : Docker Login to quay.io
80
86
if : ${{ env.REGISTRY == 'quay.io' && github.ref == 'refs/heads/main' }}
@@ -86,26 +92,41 @@ jobs:
86
92
uses : docker/login-action@v3
87
93
with : { registry: "ghcr.io", username: "${{ github.repository_owner }}", password: "${{ secrets.GITHUB_TOKEN }}" }
88
94
89
- - name : Build and Push LinuxKit containers for ${{matrix.docker_arch}}
95
+ - name : Build and Push and Export LinuxKit containers for ${{matrix.docker_arch}}
90
96
env :
91
97
DOCKER_ARCH : " ${{ matrix.docker_arch }}"
92
98
DO_PUSH : " ${{ github.ref == 'refs/heads/main' && 'yes' || 'no' }}"
99
+ EXPORT_LK_CONTAINERS : " ${{ github.event_name == 'pull_request' && 'yes' || 'no' }}" # Builds on PRs don't push images to a registry so they need to be passed on through GitHub Artifacts.
100
+ EXPORT_LK_CONTAINERS_DIR : " ${{ runner.temp }}"
93
101
run : bash build.sh linuxkit-containers
94
-
102
+
103
+ - name : Upload Linuxkit Docker images as GitHub Artifacts
104
+ uses : actions/upload-artifact@v4
105
+ with :
106
+ name : linuxkit-images-${{ matrix.docker_arch }}
107
+ path : ${{ runner.temp }}/*-${{ matrix.docker_arch }}.tar.gz
108
+ retention-days : 1
109
+
95
110
build-kernels :
96
111
needs : [ matrix_prep ] # depend on the previous job...
97
- runs-on : " ${{ matrix.runner }}" # the runner to use is determined by the 'gha-matrix' code
112
+ runs-on :
113
+ group : Default
114
+ labels : " ${{ matrix.runner }}" # the runner to use is determined by the 'gha-matrix' code
98
115
strategy :
99
116
fail-fast : false # let other jobs try to complete if one fails, kernels might take long, and they'd be skipped on the next run
100
117
matrix :
101
118
include : ${{ fromJSON(needs.matrix_prep.outputs.kernels_json) }}
102
119
name : " Kernel ${{ matrix.kernel }}"
103
120
steps :
104
121
- name : Checkout build repo
105
- uses : actions/checkout@v4
122
+ uses : actions/checkout@v5
106
123
107
124
- name : Set up Docker Buildx # nb: no need for qemu here, kernels are cross-compiled, instead of the compilation being emulated
108
125
uses : docker/setup-buildx-action@v3
126
+ with :
127
+ buildkitd-config-inline : |
128
+ [registry."docker.io"]
129
+ mirrors = ["mirror.gcr.io"]
109
130
110
131
- name : Docker Login to quay.io
111
132
if : ${{ env.REGISTRY == 'quay.io' && github.ref == 'refs/heads/main' }}
@@ -117,25 +138,40 @@ jobs:
117
138
uses : docker/login-action@v3
118
139
with : { registry: "ghcr.io", username: "${{ github.repository_owner }}", password: "${{ secrets.GITHUB_TOKEN }}" }
119
140
120
- - name : Build and push Kernel ${{matrix.kernel}} (${{ matrix.arch }})
141
+ - name : Build and Push and Export Kernel ${{matrix.kernel}} (${{ matrix.arch }})
121
142
env :
122
143
DO_PUSH : " ${{ github.ref == 'refs/heads/main' && 'yes' || 'no' }}"
144
+ EXPORT_KERNEL_IMAGE : " ${{ github.event_name == 'pull_request' && 'yes' || 'no' }}" # Builds on PRs don't push images to a registry so they need to be passed on through GitHub Artifacts.
145
+ EXPORT_KERNEL_IMAGE_DIR : " ${{ runner.temp }}"
123
146
run : bash build.sh build-kernel "${{ matrix.kernel }}"
124
147
148
+ - name : Upload Kernel Docker images as GitHub Artifacts
149
+ uses : actions/upload-artifact@v4
150
+ with :
151
+ name : kernel-images-${{ matrix.kernel }}
152
+ path : ${{ runner.temp }}/hook-kernel-*.tar.gz
153
+ retention-days : 1
154
+
125
155
build-hook-ensemble :
126
156
needs : [ matrix_prep, build-linuxkit-containers, build-kernels ] # depend on the previous job...
127
- runs-on : " ${{ matrix.runner }}" # the runner to use is determined by the 'gha-matrix' code
157
+ runs-on :
158
+ group : Default
159
+ labels : " ${{ matrix.runner }}" # the runner to use is determined by the 'gha-matrix' code
128
160
strategy :
129
161
fail-fast : false # let other jobs try to complete if one fails
130
162
matrix :
131
163
include : ${{ fromJSON(needs.matrix_prep.outputs.lk_hooks_json) }}
132
164
name : " Hook ${{ matrix.kernel }}"
133
165
steps :
134
166
- name : Checkout build repo
135
- uses : actions/checkout@v4
167
+ uses : actions/checkout@v5
136
168
137
169
- name : Set up Docker Buildx # nb: no need for qemu here, kernels are cross-compiled, instead of the compilation being emulated
138
170
uses : docker/setup-buildx-action@v3
171
+ with :
172
+ buildkitd-config-inline : |
173
+ [registry."docker.io"]
174
+ mirrors = ["mirror.gcr.io"]
139
175
140
176
- name : Docker Login to DockerHub # read-only token, required to be able to pull all the linuxkit pkgs without getting rate limited.
141
177
if : ${{ env.LOGIN_TO_DOCKERHUB == 'yes' && github.ref == 'refs/heads/main' }}
@@ -163,6 +199,42 @@ jobs:
163
199
lk-cache-${{ matrix.docker_arch }}
164
200
save-always : true # always save the cache, even if build fails
165
201
202
+ - name : Download Linuxkit artifacts
203
+ uses : actions/download-artifact@v5
204
+ with :
205
+ name : linuxkit-images-${{ matrix.docker_arch }}
206
+ path : ${{ runner.temp }}
207
+
208
+ - name : Load Linuxkit Docker images into local Docker daemon
209
+ run : |
210
+ ls "${{ runner.temp }}"
211
+ imgs=$(ls "${{ runner.temp }}" | grep tar.gz | xargs)
212
+ echo "Found hook images: ${imgs}"
213
+ for img in ${imgs}; do
214
+ echo "extracting and loading image: ${{ runner.temp }}/${img}"
215
+ gunzip -d "${{ runner.temp }}/${img}"
216
+ docker load --input "${{ runner.temp }}/${img%.*}"
217
+ done
218
+ docker images
219
+
220
+ - name : Download Kernel artifacts
221
+ uses : actions/download-artifact@v5
222
+ with :
223
+ name : kernel-images-${{ matrix.kernel }}
224
+ path : ${{ runner.temp }}
225
+
226
+ - name : Load Kernel Docker images into local Docker daemon
227
+ run : |
228
+ ls "${{ runner.temp }}"
229
+ imgs=$(ls "${{ runner.temp }}" | grep tar.gz | xargs)
230
+ echo "Found kernel images: ${{ runner.temp }}/${imgs}"
231
+ for img in ${imgs}; do
232
+ echo "extracting and loading image: ${{ runner.temp }}/${img}"
233
+ gunzip -d "${{ runner.temp }}/${img}"
234
+ docker load --input "${{ runner.temp }}/${img%.*}"
235
+ done
236
+ docker images
237
+
166
238
- name : " Build Hook with Kernel ${{matrix.kernel}} (${{ matrix.arch }}) - cache: ${{matrix.gha_cache}}"
167
239
env :
168
240
DO_BUILD_LK_CONTAINERS : " no" # already built them; this is only for hook/linuxkit.
@@ -181,6 +253,7 @@ jobs:
181
253
path : |
182
254
out/*.tar.gz
183
255
out/*.iso
256
+ retention-days : 1
184
257
185
258
release-latest :
186
259
name : Publish all Hooks to GitHub Releases
@@ -190,10 +263,10 @@ jobs:
190
263
steps :
191
264
192
265
- name : Checkout code
193
- uses : actions/checkout@v4
266
+ uses : actions/checkout@v5
194
267
195
268
- name : Download built Hook artifacts
196
- uses : actions/download-artifact@v4
269
+ uses : actions/download-artifact@v5
197
270
with :
198
271
pattern : " hook-tarball-*"
199
272
merge-multiple : true
@@ -262,10 +335,10 @@ jobs:
262
335
steps :
263
336
264
337
- name : Checkout code
265
- uses : actions/checkout@v4
338
+ uses : actions/checkout@v5
266
339
267
340
- name : Download built Hook artifacts
268
- uses : actions/download-artifact@v4
341
+ uses : actions/download-artifact@v5
269
342
with :
270
343
pattern : " hook-tarball-*"
271
344
merge-multiple : true
0 commit comments