Skip to content

Commit 965f063

Browse files
committed
.github/workflows/gen-images: add support for generating WSL images
1 parent 1681645 commit 965f063

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/gen-images.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ on:
5252
default: "rpi-armv6l rpi-armv6l-musl rpi-armv7l rpi-armv7l-musl rpi-aarch64 rpi-aarch64-musl"
5353
required: false
5454
type: string
55+
wsl_flag:
56+
description: "Build WSL images"
57+
default: true
58+
required: true
59+
type: boolean
60+
wsl:
61+
description: "Archs to build WSL images for"
62+
default: "x86_64 x86_64-musl aarch64 aarch64-musl"
63+
required: false
64+
type: string
5565

5666
concurrency:
5767
group: ${{ github.workflow }}-${{ github.ref }}
@@ -74,6 +84,7 @@ jobs:
7484
rootfs: ${{ steps.prep.outputs.rootfs }}
7585
platformfs: ${{ steps.prep.outputs.platformfs }}
7686
sbc_imgs: ${{ steps.prep.outputs.sbc_imgs }}
87+
wsl: ${{ steps.prep.outputs.wsl }}
7788

7889
steps:
7990
- name: Prepare Environment
@@ -97,6 +108,7 @@ jobs:
97108
echo "rootfs=$(echo "${{ inputs.rootfs }}" | jsonify)" >> $GITHUB_OUTPUT
98109
echo "platformfs=$(echo "${{ inputs.platformfs }}" | jsonify)" >> $GITHUB_OUTPUT
99110
echo "sbc_imgs=$(echo "${{ inputs.sbc_imgs }}" | jsonify)" >> $GITHUB_OUTPUT
111+
echo "wsl=$(echo "${{ inputs.wsl }}" | jsonify)" >> $GITHUB_OUTPUT
100112
101113
build-live-isos:
102114
name: Build Live ISOs
@@ -282,6 +294,52 @@ jobs:
282294
!distdir-${{ needs.prepare.outputs.datecode }}/*PLATFORMFS*
283295
if-no-files-found: error
284296

297+
build-wsl:
298+
name: Build WSL Images
299+
runs-on: ubuntu-latest
300+
needs: prepare
301+
if: ${{ inputs.wsl_flag }}
302+
303+
strategy:
304+
matrix:
305+
arch: ${{ fromJson(needs.prepare.outputs.wsl) }}
306+
307+
container:
308+
image: 'ghcr.io/void-linux/void-mklive:20250116R1'
309+
options: --privileged
310+
volumes:
311+
- /dev:/dev
312+
env:
313+
PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
314+
MKLIVE_REV: "${{ needs.prepare.outputs.revision }}"
315+
316+
steps:
317+
- name: Prepare container
318+
shell: sh
319+
run: xbps-install -Syu xbps && xbps-install -yu
320+
321+
- name: Clone and checkout
322+
uses: classabbyamp/treeless-checkout-action@v1
323+
324+
- name: Build WSL Images
325+
run: |
326+
make wsl-all-print wsl-all \
327+
SUDO= REPOSITORY="${{ needs.prepare.outputs.mirror }}" \
328+
DATECODE="${{ needs.prepare.outputs.datecode }}" \
329+
ARCHS="${{ matrix.arch }}"
330+
331+
- name: Prepare artifacts for upload
332+
run: |
333+
make dist DATECODE="${{ needs.prepare.outputs.datecode }}"
334+
- name: Upload artifacts
335+
uses: actions/upload-artifact@v4
336+
with:
337+
name: void-wsl-${{ matrix.arch }}-${{ needs.prepare.outputs.datecode }}
338+
path: |
339+
distdir-${{ needs.prepare.outputs.datecode }}/*
340+
if-no-files-found: error
341+
342+
285343
merge-artifacts:
286344
name: Combine artifacts
287345
runs-on: ubuntu-latest
@@ -292,6 +350,7 @@ jobs:
292350
- build-rootfs
293351
- build-platformfs
294352
- build-sbc-img
353+
- build-wsl
295354

296355
container:
297356
image: 'ghcr.io/void-linux/void-mklive:20250116R1'

0 commit comments

Comments
 (0)