Skip to content

Commit 7e2dfd4

Browse files
committed
Split platform CI from release archives
1 parent 7fa6b9e commit 7e2dfd4

4 files changed

Lines changed: 102 additions & 17 deletions

File tree

.github/workflows/rolling-release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,23 @@ env:
1818
LJ_RELEASE_RUN_STOCK: "0"
1919

2020
jobs:
21+
validate:
22+
name: Validate rolling tag
23+
runs-on: ubuntu-24.04
24+
env:
25+
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
26+
steps:
27+
- name: Validate bX.Y.Z tag
28+
run: |
29+
if [[ ! "$RELEASE_TAG" =~ ^b[0-9]+[.][0-9]+[.][0-9]+$ ]]; then
30+
echo "::error::rolling releases must use b<major>.<minor>.<patch> tags, got '$RELEASE_TAG'"
31+
exit 1
32+
fi
33+
2134
linux:
2235
name: Linux x86_64 artifact
2336
runs-on: ubuntu-24.04
37+
needs: validate
2438
env:
2539
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
2640
SOURCE_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
@@ -58,6 +72,7 @@ jobs:
5872
macos:
5973
name: macOS x86_64 artifact
6074
runs-on: macos-13
75+
needs: validate
6176
env:
6277
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
6378
SOURCE_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
@@ -100,6 +115,7 @@ jobs:
100115
name: Windows x86_64 UCRT artifact
101116
runs-on: ubuntu-24.04
102117
container: debian:trixie
118+
needs: validate
103119
env:
104120
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
105121
SOURCE_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}

notes/release-ci-artifacts.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Release and platform CI artifacts
2+
3+
2026-07-01:
4+
- Rolling-release packaging now validates `b<major>.<minor>.<patch>` tags before
5+
artifact jobs and keeps Linux, macOS x86_64 target 13.0, and Windows UCRT
6+
archive creation behind `tools/release/build_artifact.sh`.
7+
- Release archives are built from `make install DESTDIR` staging trees. The
8+
archive checks remain release-only, including macOS/Windows binary checks via
9+
the release harness and optional Darling/Wine runners.
10+
- Normal GitHub CI now uses `tools/ci/platform_build.sh` for each platform and
11+
only builds plus runs a direct platform smoke (`jit.os`, `jit.arch`, and the
12+
threading module). It does not run the release archive harness or stock
13+
semantics suites.
14+
- CI and release jobs install/use stock `luajit` for the Lua test harness. The
15+
local host currently has `/usr/bin/luajit` from the Debian package.
16+
- Local verification:
17+
- `bash -n tools/release/build_artifact.sh tools/ci/platform_build.sh`;
18+
- `tools/ci/platform_build.sh linux-x86_64`;
19+
- `tools/release/build_artifact.sh linux-x86_64 b0.0.0 /tmp/lj-lockless-release-smoke`;
20+
- `LUA=luajit tools/ci/lua_test.sh --list` shows all release binary/archive
21+
cases.

tools/ci/platform_build.sh

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,69 @@ build_make() {
3838
make -C "$root" -j"$jobs" "$@"
3939
}
4040

41-
run_release_binary_check() {
42-
local check=$1
43-
shift
44-
env LJ_RELEASE_RUN_STOCK=0 "$@" "$root/tools/ci/lua_test.sh" "$check"
41+
smoke_code='print(jit.os, jit.arch); local threading = require("threading"); assert(type(threading.spawn) == "function"); assert(type(threading.gcstats) == "function")'
42+
43+
assert_platform_output() {
44+
local label=$1
45+
local out=$2
46+
local osname=$3
47+
if ! printf '%s\n' "$out" |
48+
grep -Eq "(^|[[:space:]])${osname}[[:space:]]+x64($|[[:space:]])"; then
49+
printf '%s\n' "$out" >&2
50+
printf 'CI %s smoke did not report %s x64\n' "$label" "$osname" >&2
51+
exit 1
52+
fi
53+
}
54+
55+
run_direct_smoke() {
56+
local label=$1
57+
local bin=$2
58+
local osname=$3
59+
local out
60+
if [ ! -x "$bin" ]; then
61+
printf 'CI %s smoke binary is not executable: %s\n' "$label" "$bin" >&2
62+
exit 1
63+
fi
64+
if ! out=$("$bin" -e "$smoke_code" 2>&1); then
65+
printf '%s\n' "$out" >&2
66+
exit 1
67+
fi
68+
assert_platform_output "$label" "$out" "$osname"
69+
printf 'CI %s binary smoke passed\n' "$label"
70+
}
71+
72+
run_windows_smoke() {
73+
local bin=$1
74+
local runner=${LJ_CI_WINDOWS_RUNNER:-${LJ_RELEASE_WINDOWS_RUNNER:-wine}}
75+
local out
76+
if [ ! -f "$bin" ]; then
77+
printf 'CI Windows smoke binary is missing: %s\n' "$bin" >&2
78+
exit 1
79+
fi
80+
if ! command -v "$runner" >/dev/null 2>&1; then
81+
printf 'CI Windows smoke runner is not in PATH: %s\n' "$runner" >&2
82+
exit 1
83+
fi
84+
if ! out=$(WINEDEBUG=-all "$runner" "$bin" -e "$smoke_code" 2>&1); then
85+
printf '%s\n' "$out" >&2
86+
exit 1
87+
fi
88+
assert_platform_output "Windows" "$out" "Windows"
89+
printf 'CI Windows binary smoke passed\n'
4590
}
4691

4792
case "$platform" in
4893
linux-x86_64)
4994
make_clean
5095
build_make
51-
run_release_binary_check release_linux_binary \
52-
LJ_RELEASE_REQUIRE=linux \
53-
LJ_RELEASE_LINUX_BIN="$root/src/luajit"
96+
run_direct_smoke "Linux" "$root/src/luajit" "Linux"
5497
;;
5598
macos-x86_64)
5699
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-13.0}
57-
macos_make_args=(TARGET_SYS=Darwin)
100+
macos_make_args=(
101+
TARGET_SYS=Darwin
102+
TARGET_FLAGS="${LJ_CI_MACOS_TARGET_FLAGS:-${LJ_RELEASE_MACOS_TARGET_FLAGS:--arch x86_64}}"
103+
)
58104
if [ -n "${LJ_CI_MACOS_CC:-${LJ_RELEASE_MACOS_CC:-}}" ]; then
59105
macos_make_args+=(CC="${LJ_CI_MACOS_CC:-${LJ_RELEASE_MACOS_CC:-}}")
60106
fi
@@ -66,9 +112,7 @@ case "$platform" in
66112
fi
67113
make_clean
68114
build_make "${macos_make_args[@]}"
69-
run_release_binary_check release_macos_binary \
70-
LJ_RELEASE_REQUIRE=macos \
71-
LJ_RELEASE_MACOS_BIN="$root/src/luajit"
115+
run_direct_smoke "macOS" "$root/src/luajit" "OSX"
72116
;;
73117
windows-x86_64-ucrt)
74118
cross=${LJ_CI_WINDOWS_CROSS:-${LJ_RELEASE_WINDOWS_CROSS:-x86_64-w64-mingw32ucrt-}}
@@ -81,9 +125,6 @@ case "$platform" in
81125
)
82126
make_clean
83127
build_make "${windows_make_args[@]}"
84-
run_release_binary_check release_windows_binary \
85-
LJ_RELEASE_REQUIRE=windows \
86-
LJ_RELEASE_WINDOWS_BIN="$root/src/luajit.exe" \
87-
LJ_RELEASE_WINDOWS_RUNNER="${LJ_RELEASE_WINDOWS_RUNNER:-wine}"
128+
run_windows_smoke "$root/src/luajit.exe"
88129
;;
89130
esac

tools/release/build_artifact.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ case "$platform" in
4040
*) usage ;;
4141
esac
4242

43+
mkdir -p "$out_dir"
44+
out_dir=$(CDPATH= cd -- "$out_dir" && pwd)
45+
4346
pkg="LuaJITMT-${tag}-${platform}"
4447
stage="${stage_parent}/${pkg}"
4548

@@ -52,7 +55,6 @@ cleanup() {
5255
}
5356
trap cleanup EXIT
5457

55-
mkdir -p "$out_dir"
5658
rm -rf "$stage"
5759

5860
make_clean() {
@@ -172,7 +174,10 @@ case "$platform" in
172174
;;
173175
macos-x86_64)
174176
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-13.0}
175-
macos_make_args=(TARGET_SYS=Darwin)
177+
macos_make_args=(
178+
TARGET_SYS=Darwin
179+
TARGET_FLAGS="${LJ_RELEASE_MACOS_TARGET_FLAGS:--arch x86_64}"
180+
)
176181
if [ -n "${LJ_RELEASE_MACOS_CC:-}" ]; then
177182
macos_make_args+=(CC="$LJ_RELEASE_MACOS_CC")
178183
fi
@@ -187,6 +192,8 @@ case "$platform" in
187192
make -C "$root" install DESTDIR="$stage" PREFIX="$prefix" \
188193
"${macos_make_args[@]}"
189194
install_doc "${stage}${prefix}/share/doc/luajitmt" "make install DESTDIR prefix tree"
195+
printf 'macos_deployment_target: %s\n' "$MACOSX_DEPLOYMENT_TARGET" \
196+
>> "${stage}${prefix}/share/doc/luajitmt/BUILDINFO"
190197
run_release_test
191198
archive=$(archive_stage)
192199
run_release_archive_test "$archive"

0 commit comments

Comments
 (0)