Files
iceBear67 fb0597578f Rework CI: cross Windows on Linux, build only on dispatch/tag
Regular push/PR runs the test job only. workflow_dispatch and v* tags
then build linux-amd64, windows-amd64, and macos-arm64 as separate
jobs. Windows is cargo-xwin from Ubuntu (MSVC ABI, Unix-host protoc)
instead of native windows-latest. Registry/git cache is shared on
Ubuntu; release target/ is not cached; xwin splat has its own cache.
2026-08-16 03:08:29 +00:00

30 lines
1013 B
Bash
Executable File

#!/usr/bin/env bash
# Shallow work/ checkout for GitHub Actions.
#
# Unlike apply-patches.sh this does not clone upstream/ (that copy is a full
# history clone for make update). CI only needs the pinned SHA + patches/.
source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
REV="$(read_rev)"
info "Fetching upstream ${REV:0:12} -> work/"
rm -rf "$WORK_DIR"
git init "$WORK_DIR"
git -C "$WORK_DIR" remote add origin "$UPSTREAM_URL"
git -C "$WORK_DIR" fetch --depth 1 origin "$REV"
git -C "$WORK_DIR" checkout --force --detach FETCH_HEAD
git -C "$WORK_DIR" checkout -B "$WORK_BRANCH"
git -C "$WORK_DIR" tag -f "$BASE_TAG"
git -C "$WORK_DIR" config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git -C "$WORK_DIR" config user.name "github-actions[bot]"
shopt -s nullglob
patches=("$PATCHES_DIR"/*.patch)
shopt -u nullglob
if ((${#patches[@]})); then
git -C "$WORK_DIR" am --3way --keep-cr --whitespace=nowarn "${patches[@]}"
fi
info "work/ ready: upstream ${REV:0:12} + ${#patches[@]} patch(es)"