diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 9acf59e..442bd1a 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -272,6 +272,62 @@ jobs: path: dist-installers/ retention-days: 30 + vbs-installers-windows: + name: "4A2 ยท VBS installers (windows target)" + needs: linux-test + runs-on: windows-gcc + # Cross-installing for Windows through VBS is new: report it without + # blocking the release until it is proven. + continue-on-error: true + steps: + - uses: actions/checkout@v4 + - name: Download the RelWithDebInfo build + uses: actions/download-artifact@v3 + with: + name: vbs-linux-build-relwithdebinfo + path: build/linux-relwithdebinfo + - name: Make the restored binaries executable + run: chmod +x build/linux-relwithdebinfo/bin/* + - name: Build and package the Windows installers with VBS + run: | + set -eu + vbs=build/linux-relwithdebinfo/bin/vbs + version="$(sed -nE 's/^project\(VoidBuildSystem VERSION ([0-9.]+).*/\1/p' CMakeLists.txt)" + label="${{ github.event.inputs.tag }}" + if [ -z "${label}" ]; then + case "${GITHUB_REF_NAME}" in + v*) label="${GITHUB_REF_NAME}" ;; + *) label="dev-$(printf '%s' "${GITHUB_SHA}" | cut -c1-7)" ;; + esac + fi + out=dist-installers-windows + prefix="$(mktemp -d)" + mkdir -p "${out}" + build_dir="build/selfhost-windows-${GITHUB_RUN_ID}" + for fmt in tar zip nuget wix; do + case "${fmt}" in + tar) ext=tar ;; + wix) ext=wxs ;; + nuget) ext=nupkg ;; + *) ext="${fmt}" ;; + esac + "${vbs}" install --project . --build-dir "${build_dir}" --profile release \ + --target-os windows --target-arch x86_64 \ + --prefix "${prefix}" --package-name VoidBuildSystem \ + --package-version "${version}" \ + --archive "${out}/vbs-${label}-windows-x86_64-${fmt}.${ext}" \ + --archive-format "${fmt}" + done + ls -l "${out}/" + - name: Upload the Windows installers + if: always() + uses: actions/upload-artifact@v3 + with: + name: vbs-installers-windows + path: dist-installers-windows/ + if-no-files-found: ignore + retention-days: 30 + # --------------------------------------------------------------------------- # 2B / 3B / 4B - Windows via Wine: VBS is cross-compiled with MinGW-w64, its # test executables run under Wine, and the Windows binaries are packaged. @@ -449,6 +505,12 @@ jobs: with: name: vbs-installers path: dist + - name: Download the Windows installers (when available) + continue-on-error: true + uses: actions/download-artifact@v3 + with: + name: vbs-installers-windows + path: dist - name: Verify the tag matches the project version run: | tag="${{ github.event.inputs.tag }}"