Files
Build-System/.gitea/scripts/windows-native.sh
T
faumaray 95801ccfd7
VoidBuildSystem CI / 1 · Requirements (push) Successful in 13s
VoidBuildSystem CI / 2C · Windows native build (debug) (push) Failing after 18s
VoidBuildSystem CI / 2C · Windows native build (sanitizers) (push) Failing after 13s
VoidBuildSystem CI / 2C · Windows native build (relwithdebinfo) (push) Failing after 13s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Canceled after 4m1s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 2B · Windows Wine build (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Canceled after 3m44s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Canceled after 0s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 3B · Windows Wine test (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 3C · Windows native test (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 3C · Windows native test (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 4B · Windows package (debug) (push) Canceled after 0s
VoidBuildSystem CI / 3C · Windows native test (debug) (push) Canceled after 3m16s
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 4B · Windows package (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 5 · Release (push) Skipped
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Canceled after 4m11s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Canceled after 2m7s
ci: add the missing Windows package job
`release` needed `windows-package`, which did not exist, so Gitea
rejected the whole workflow (run with no jobs). Add `4B · Windows
package` after the Windows native tests: it restores the build, creates
the RelWithDebInfo/Debug/Sanitizers packages and uploads them. The
windows-native script now has separate build, test and package phases.

While the Windows native port is unfinished the package lane stays
non-blocking and `release` runs with always(); remove those two bits to
make a Windows failure block the release.
2026-12-05 15:48:02 +03:00

68 lines
2.2 KiB
Bash

#!/usr/bin/env bash
# Native Windows lane for one variant, driven inside MSYS2 UCRT64.
#
# windows-native.sh build <variant> <build_type> configure + build
# windows-native.sh test <variant> <build_type> run CTest
# windows-native.sh package <variant> <build_type> package the build outputs
#
# Track C3 caveat: the VBS platform backends are Linux-only today and
# VoidLibrary does not qualify Archive/Configuration/Crypto/System for Windows
# yet (Void/Library issue #65), so this lane fails until that port lands.
set -euo pipefail
phase="${1:?phase (build or test)}"
variant="${2:?variant}"
build_type="${3:?build type}"
root="$(cd "$(dirname "$0")/../.." && pwd)"
cd "${root}"
echo "workspace: $(pwd)"
build="build/windows-${variant}"
# Make sure the UCRT64 environment provides the build tools.
if ! command -v cmake >/dev/null 2>&1 || ! command -v ninja >/dev/null 2>&1; then
if command -v pacman >/dev/null 2>&1; then
pacman -S --noconfirm --needed \
mingw-w64-ucrt-x86_64-cmake \
mingw-w64-ucrt-x86_64-ninja \
mingw-w64-ucrt-x86_64-gcc
fi
fi
case "${phase}" in
build)
cmake -S . -B "${build}" -G Ninja \
-DCMAKE_BUILD_TYPE="${build_type}" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build "${build}" --parallel 4
;;
test)
ctest --test-dir "${build}" --output-on-failure --no-tests=error
;;
package)
out="dist-windows-${variant}"
label="${VBS_RELEASE_TAG:-}"
if [ -z "${label}" ]; then
case "${GITHUB_REF_NAME:-}" in
v*) label="${GITHUB_REF_NAME}" ;;
*) label="dev-$(printf '%s' "${GITHUB_SHA:-local}" | cut -c1-7)" ;;
esac
fi
stage="$(mktemp -d)"
mkdir -p "${stage}/bin" "${stage}/include" "${stage}/lib" "${out}"
cp "${build}"/bin/*.exe "${stage}/bin/" 2>/dev/null || true
cp -r include/Void "${stage}/include/"
find "${build}" -maxdepth 1 -name 'libVoidBuild_Sdk.a' -exec cp {} "${stage}/lib/" \;
cp README.md LICENSE "${stage}/"
tar -czf "${out}/vbs-${label}-windows-x86_64-${variant}.tar.gz" -C "${stage}" .
ls -l "${out}/"
;;
*)
echo "unknown phase '${phase}' (expected build, test or package)" >&2
exit 2
;;
esac