Skip to content

Commit 71fabc6

Browse files
committed
.github/workflows/gen-images: add aarch64* live isos, matrixify jobs
also simplify environment prep and fix qemu dependencies the matrix should ensure we never run out of space while building unfortunately, github limits us to 10 inputs so we can't add a selector for live iso platforms
1 parent 3d239df commit 71fabc6

File tree

1 file changed

+50
-33
lines changed

1 file changed

+50
-33
lines changed

.github/workflows/gen-images.yml

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
type: boolean
1515
live_archs:
1616
description: "Archs to build live ISOs for"
17-
default: "x86_64 x86_64-musl i686"
17+
default: "x86_64 x86_64-musl i686 aarch64 aarch64-musl"
1818
required: false
1919
type: string
2020
live_flavors:
@@ -69,6 +69,11 @@ jobs:
6969
datecode: ${{ steps.prep.outputs.datecode }}
7070
revision: ${{ steps.prep.outputs.revision }}
7171
mirror: ${{ steps.prep.outputs.mirror }}
72+
live_archs: ${{ steps.prep.outputs.live_archs }}
73+
live_flavors: ${{ steps.prep.outputs.live_flavors }}
74+
rootfs: ${{ steps.prep.outputs.rootfs }}
75+
platformfs: ${{ steps.prep.outputs.platformfs }}
76+
sbc_imgs: ${{ steps.prep.outputs.sbc_imgs }}
7277

7378
steps:
7479
- name: Prepare Environment
@@ -82,12 +87,28 @@ jobs:
8287
echo "revision=${GITHUB_SHA:0:8}" >> $GITHUB_OUTPUT
8388
echo "mirror=https://repo-ci.voidlinux.org/current" >> $GITHUB_OUTPUT
8489
90+
jsonify() {
91+
sed 's/\s\+/ /g' | jq -Rrc 'split(" ")'
92+
}
93+
94+
echo "live_archs=$(echo "${{ inputs.live_archs }}" | jsonify)" >> $GITHUB_OUTPUT
95+
echo "live_flavors=$(echo "${{ inputs.live_flavors }}" | jsonify)" >> $GITHUB_OUTPUT
96+
97+
echo "rootfs=$(echo "${{ inputs.rootfs }}" | jsonify)" >> $GITHUB_OUTPUT
98+
echo "platformfs=$(echo "${{ inputs.platformfs }}" | jsonify)" >> $GITHUB_OUTPUT
99+
echo "sbc_imgs=$(echo "${{ inputs.sbc_imgs }}" | jsonify)" >> $GITHUB_OUTPUT
100+
85101
build-live-isos:
86102
name: Build Live ISOs
87103
runs-on: ubuntu-latest
88104
needs: prepare
89105
if: ${{ inputs.live_iso_flag }}
90106

107+
strategy:
108+
matrix:
109+
arch: ${{ fromJson(needs.prepare.outputs.live_archs) }}
110+
flavor: ${{ fromJson(needs.prepare.outputs.live_flavors) }}
111+
91112
container:
92113
image: 'ghcr.io/void-linux/void-glibc-full:20231230R1'
93114
options: --privileged
@@ -105,12 +126,8 @@ jobs:
105126
mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
106127
sed -i 's|https://repo-default.voidlinux.org/current|'"${{ needs.prepare.outputs.mirror }}"'|g' \
107128
/etc/xbps.d/*-repository-*.conf
108-
# Sync and upgrade once, assume error comes from xbps update
109-
xbps-install -Syu || xbps-install -yu xbps
110-
# Upgrade again (in case there was a xbps update)
111-
xbps-install -yu
112-
# Install depedencies
113-
xbps-install -yu bash make git kmod xz lzo qemu-user-static outils dosfstools e2fsprogs
129+
xbps-install -Syu xbps && xbps-install -yu
130+
xbps-install -yu bash make git kmod xz lzo qemu-user-aarch64 binfmt-support outils dosfstools e2fsprogs
114131
- name: Clone and checkout
115132
uses: classabbyamp/treeless-checkout-action@v1
116133

@@ -119,15 +136,15 @@ jobs:
119136
make live-iso-all-print live-iso-all \
120137
SUDO= REPOSITORY="${{ needs.prepare.outputs.mirror }}" \
121138
DATECODE="${{ needs.prepare.outputs.datecode }}" \
122-
LIVE_ARCHS="${{ inputs.live_archs }}" LIVE_FLAVORS="${{ inputs.live_flavors }}"
139+
LIVE_ARCHS="${{ matrix.arch }}" LIVE_FLAVORS="${{ matrix.flavor }}"
123140
124141
- name: Prepare artifacts for upload
125142
run: |
126143
make dist DATECODE="${{ needs.prepare.outputs.datecode }}"
127144
- name: Upload artifacts
128145
uses: actions/upload-artifact@v4
129146
with:
130-
name: void-iso-${{ needs.prepare.outputs.datecode }}
147+
name: void-iso-${{ matrix.arch }}-${{ matrix.flavor }}-${{ needs.prepare.outputs.datecode }}
131148
path: |
132149
distdir-${{ needs.prepare.outputs.datecode }}/*
133150
if-no-files-found: error
@@ -138,6 +155,10 @@ jobs:
138155
needs: prepare
139156
if: ${{ inputs.rootfs_flag }}
140157

158+
strategy:
159+
matrix:
160+
arch: ${{ fromJson(needs.prepare.outputs.rootfs) }}
161+
141162
container:
142163
image: 'ghcr.io/void-linux/void-glibc-full:20231230R1'
143164
options: --privileged
@@ -155,12 +176,8 @@ jobs:
155176
mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
156177
sed -i 's|https://repo-default.voidlinux.org/current|'"${{ needs.prepare.outputs.mirror }}"'|g' \
157178
/etc/xbps.d/*-repository-*.conf
158-
# Sync and upgrade once, assume error comes from xbps update
159-
xbps-install -Syu || xbps-install -yu xbps
160-
# Upgrade again (in case there was a xbps update)
161-
xbps-install -yu
162-
# Install depedencies
163-
xbps-install -yu bash make git kmod xz lzo qemu-user-static outils dosfstools e2fsprogs
179+
xbps-install -Syu xbps && xbps-install -yu
180+
xbps-install -yu bash make git kmod xz lzo qemu-user-arm qemu-user-aarch64 binfmt-support outils dosfstools e2fsprogs
164181
- name: Clone and checkout
165182
uses: classabbyamp/treeless-checkout-action@v1
166183

@@ -169,15 +186,15 @@ jobs:
169186
make rootfs-all-print rootfs-all \
170187
SUDO= REPOSITORY="${{ needs.prepare.outputs.mirror }}" \
171188
DATECODE="${{ needs.prepare.outputs.datecode }}" \
172-
ARCHS="${{ inputs.rootfs }}"
189+
ARCHS="${{ matrix.arch }}"
173190
174191
- name: Prepare artifacts for upload
175192
run: |
176193
make dist DATECODE="${{ needs.prepare.outputs.datecode }}"
177194
- name: Upload artifacts
178195
uses: actions/upload-artifact@v4
179196
with:
180-
name: void-rootfs-${{ needs.prepare.outputs.datecode }}
197+
name: void-rootfs-${{ matrix.arch }}-${{ needs.prepare.outputs.datecode }}
181198
path: |
182199
distdir-${{ needs.prepare.outputs.datecode }}/*
183200
if-no-files-found: error
@@ -188,6 +205,10 @@ jobs:
188205
needs: prepare
189206
if: ${{ inputs.platformfs_flag }}
190207

208+
strategy:
209+
matrix:
210+
platform: ${{ fromJson(needs.prepare.outputs.platformfs) }}
211+
191212
container:
192213
image: 'ghcr.io/void-linux/void-glibc-full:20231230R1'
193214
options: --privileged
@@ -205,12 +226,8 @@ jobs:
205226
mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
206227
sed -i 's|https://repo-default.voidlinux.org/current|'"${{ needs.prepare.outputs.mirror }}"'|g' \
207228
/etc/xbps.d/*-repository-*.conf
208-
# Sync and upgrade once, assume error comes from xbps update
209-
xbps-install -Syu || xbps-install -yu xbps
210-
# Upgrade again (in case there was a xbps update)
211-
xbps-install -yu
212-
# Install depedencies
213-
xbps-install -yu bash make git kmod xz lzo qemu-user-static outils dosfstools e2fsprogs
229+
xbps-install -Syu xbps && xbps-install -yu
230+
xbps-install -yu bash make git kmod xz lzo qemu-user-arm qemu-user-aarch64 binfmt-support outils dosfstools e2fsprogs
214231
- name: Clone and checkout
215232
uses: classabbyamp/treeless-checkout-action@v1
216233

@@ -219,15 +236,15 @@ jobs:
219236
make platformfs-all-print platformfs-all \
220237
SUDO= REPOSITORY="${{ needs.prepare.outputs.mirror }}" \
221238
DATECODE="${{ needs.prepare.outputs.datecode }}" \
222-
PLATFORMS="${{ inputs.platformfs }}"
239+
PLATFORMS="${{ matrix.platform }}"
223240
224241
- name: Prepare artifacts for upload
225242
run: |
226243
make dist DATECODE="${{ needs.prepare.outputs.datecode }}"
227244
- name: Upload artifacts
228245
uses: actions/upload-artifact@v4
229246
with:
230-
name: void-platformfs-${{ needs.prepare.outputs.datecode }}
247+
name: void-platformfs-${{ matrix.platform }}-${{ needs.prepare.outputs.datecode }}
231248
path: |
232249
distdir-${{ needs.prepare.outputs.datecode }}/*
233250
!distdir-${{ needs.prepare.outputs.datecode }}/*ROOTFS*
@@ -239,6 +256,10 @@ jobs:
239256
needs: prepare
240257
if: ${{ inputs.sbc_img_flag }}
241258

259+
strategy:
260+
matrix:
261+
platform: ${{ fromJson(needs.prepare.outputs.sbc_imgs) }}
262+
242263
container:
243264
image: 'ghcr.io/void-linux/void-glibc-full:20231230R1'
244265
options: --privileged
@@ -256,12 +277,8 @@ jobs:
256277
mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
257278
sed -i 's|https://repo-default.voidlinux.org/current|'"${{ needs.prepare.outputs.mirror }}"'|g' \
258279
/etc/xbps.d/*-repository-*.conf
259-
# Sync and upgrade once, assume error comes from xbps update
260-
xbps-install -Syu || xbps-install -yu xbps
261-
# Upgrade again (in case there was a xbps update)
262-
xbps-install -yu
263-
# Install depedencies
264-
xbps-install -yu bash make git kmod xz lzo qemu-user-static outils dosfstools e2fsprogs
280+
xbps-install -Syu xbps && xbps-install -yu
281+
xbps-install -yu bash make git kmod xz lzo qemu-user-arm qemu-user-aarch64 binfmt-support outils dosfstools e2fsprogs
265282
- name: Clone and checkout
266283
uses: classabbyamp/treeless-checkout-action@v1
267284

@@ -270,15 +287,15 @@ jobs:
270287
make images-all-sbc-print images-all-sbc \
271288
SUDO= REPOSITORY="${{ needs.prepare.outputs.mirror }}" \
272289
DATECODE="${{ needs.prepare.outputs.datecode }}" \
273-
SBC_IMGS="${{ inputs.sbc_imgs }}"
290+
SBC_IMGS="${{ matrix.platform }}"
274291
275292
- name: Prepare artifacts for upload
276293
run: |
277294
make dist DATECODE="${{ needs.prepare.outputs.datecode }}"
278295
- name: Upload artifacts
279296
uses: actions/upload-artifact@v4
280297
with:
281-
name: void-sbc-img-${{ needs.prepare.outputs.datecode }}
298+
name: void-sbc-img-${{ matrix.platform }}-${{ needs.prepare.outputs.datecode }}
282299
path: |
283300
distdir-${{ needs.prepare.outputs.datecode }}/*
284301
!distdir-${{ needs.prepare.outputs.datecode }}/*ROOTFS*

0 commit comments

Comments
 (0)