diff --git a/.github/workflows/gen-images.yml b/.github/workflows/gen-images.yml index efc5803ad2..ad62998981 100644 --- a/.github/workflows/gen-images.yml +++ b/.github/workflows/gen-images.yml @@ -52,6 +52,16 @@ on: default: "rpi-armv6l rpi-armv6l-musl rpi-armv7l rpi-armv7l-musl rpi-aarch64 rpi-aarch64-musl" required: false type: string + wsl_flag: + description: "Build WSL images" + default: true + required: true + type: boolean + wsl: + description: "Archs to build WSL images for" + default: "x86_64 x86_64-musl aarch64 aarch64-musl" + required: false + type: string concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -74,6 +84,7 @@ jobs: rootfs: ${{ steps.prep.outputs.rootfs }} platformfs: ${{ steps.prep.outputs.platformfs }} sbc_imgs: ${{ steps.prep.outputs.sbc_imgs }} + wsl: ${{ steps.prep.outputs.wsl }} steps: - name: Prepare Environment @@ -97,6 +108,7 @@ jobs: echo "rootfs=$(echo "${{ inputs.rootfs }}" | jsonify)" >> $GITHUB_OUTPUT echo "platformfs=$(echo "${{ inputs.platformfs }}" | jsonify)" >> $GITHUB_OUTPUT echo "sbc_imgs=$(echo "${{ inputs.sbc_imgs }}" | jsonify)" >> $GITHUB_OUTPUT + echo "wsl=$(echo "${{ inputs.wsl }}" | jsonify)" >> $GITHUB_OUTPUT build-live-isos: name: Build Live ISOs @@ -282,6 +294,52 @@ jobs: !distdir-${{ needs.prepare.outputs.datecode }}/*PLATFORMFS* if-no-files-found: error + build-wsl: + name: Build WSL Images + runs-on: ubuntu-latest + needs: prepare + if: ${{ inputs.wsl_flag }} + + strategy: + matrix: + arch: ${{ fromJson(needs.prepare.outputs.wsl) }} + + container: + image: 'ghcr.io/void-linux/void-mklive:20250116R1' + options: --privileged + volumes: + - /dev:/dev + env: + PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin' + MKLIVE_REV: "${{ needs.prepare.outputs.revision }}" + + steps: + - name: Prepare container + shell: sh + run: xbps-install -Syu xbps && xbps-install -yu + + - name: Clone and checkout + uses: classabbyamp/treeless-checkout-action@v1 + + - name: Build WSL Images + run: | + make wsl-all-print wsl-all \ + SUDO= REPOSITORY="${{ needs.prepare.outputs.mirror }}" \ + DATECODE="${{ needs.prepare.outputs.datecode }}" \ + ARCHS="${{ matrix.arch }}" + + - name: Prepare artifacts for upload + run: | + make dist DATECODE="${{ needs.prepare.outputs.datecode }}" + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: void-wsl-${{ matrix.arch }}-${{ needs.prepare.outputs.datecode }} + path: | + distdir-${{ needs.prepare.outputs.datecode }}/* + if-no-files-found: error + + merge-artifacts: name: Combine artifacts runs-on: ubuntu-latest @@ -292,6 +350,7 @@ jobs: - build-rootfs - build-platformfs - build-sbc-img + - build-wsl container: image: 'ghcr.io/void-linux/void-mklive:20250116R1' diff --git a/.gitignore b/.gitignore index fb75b6b65f..a5ee614c5c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.raw *.tar.gz *.box +*.wsl xbps-cache xbps-cachedir* stamps* diff --git a/Makefile b/Makefile index fd23010a7e..f3432ce58e 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,8 @@ T_CLOUD_IMGS=GCP{,-musl} T_PXE_ARCHS=x86_64{,-musl} +T_WSL_ARCHS={x86_64,aarch64}{,-musl} + LIVE_ARCHS:=$(shell echo $(T_LIVE_ARCHS)) LIVE_FLAVORS:=base enlightenment xfce mate cinnamon gnome kde lxde lxqt xfce-wayland LIVE_PLATFORMS:=pinebookpro x13s @@ -19,6 +21,7 @@ PLATFORMS:=$(shell echo $(T_PLATFORMS)) SBC_IMGS:=$(shell echo $(T_SBC_IMGS)) CLOUD_IMGS:=$(shell echo $(T_CLOUD_IMGS)) PXE_ARCHS:=$(shell echo $(T_PXE_ARCHS)) +WSL_ARCHS:=$(shell echo $(T_WSL_ARCHS)) ALL_LIVE_ISO=$(foreach arch,$(LIVE_ARCHS), $(foreach flavor,$(LIVE_FLAVORS),void-live-$(arch)-$(DATECODE)-$(flavor).iso)) ALL_ROOTFS=$(foreach arch,$(ARCHS),void-$(arch)-ROOTFS-$(DATECODE).tar.xz) @@ -26,6 +29,7 @@ ALL_PLATFORMFS=$(foreach platform,$(PLATFORMS),void-$(platform)-PLATFORMFS-$(DAT ALL_SBC_IMAGES=$(foreach platform,$(SBC_IMGS),void-$(platform)-$(DATECODE).img.xz) ALL_CLOUD_IMAGES=$(foreach cloud,$(CLOUD_IMGS),void-$(cloud)-$(DATECODE).tar.gz) ALL_PXE_ARCHS=$(foreach arch,$(PXE_ARCHS),void-$(arch)-NETBOOT-$(DATECODE).tar.gz) +ALL_WSL=$(foreach arch,$(WSL_ARCHS),void-$(arch)-$(DATECODE).wsl) SUDO := sudo @@ -122,4 +126,14 @@ void-%-NETBOOT-$(DATECODE).tar.gz: void-%-ROOTFS-$(DATECODE).tar.xz mknet.sh $(SUDO) ./mknet.sh void-$*-ROOTFS-$(DATECODE).tar.xz @[ -n "${CI}" ] && printf '::endgroup::\n' || true -.PHONY: all checksum dist live-iso-all live-iso-all-print rootfs-all-print rootfs-all platformfs-all-print platformfs-all pxe-all-print pxe-all +wsl-all: $(ALL_WSL) + +wsl-all-print: + @echo $(ALL_WSL) | sed "s: :\n:g" + +void-%-$(DATECODE).wsl: mkrootfs.sh + @[ -n "${CI}" ] && printf "::group::\x1b[32mBuilding $@...\x1b[0m\n" || true + $(SUDO) ./mkrootfs.sh $(XBPS_REPOSITORY) -x $(COMPRESSOR_THREADS) -b wsl-base -o $@ $* + @[ -n "${CI}" ] && printf '::endgroup::\n' || true + +.PHONY: all checksum dist live-iso-all live-iso-all-print rootfs-all-print rootfs-all platformfs-all-print platformfs-all pxe-all-print pxe-all wsl-all-print wsl-all