Some checks failed
wai-app and Create / wai-app · does this change touch it (push) Successful in 17s
joule-moq-web browser client / joule-moq-web · does this change touch it (push) Successful in 16s
joule-moq-room room service / joule-moq-room · does this change touch it (push) Successful in 36s
joule-moq-remote host agent / joule-moq-remote · does this change touch it (push) Successful in 39s
wai-audit collector and player integration / does this change touch it (push) Successful in 21s
WAI operation catalogue / does this change touch it (push) Successful in 21s
wai-ledger service / does this change touch it (push) Successful in 19s
wai-fleet service / does this change touch it (push) Successful in 20s
wai-quantum studio and desktop / does this change touch it (push) Successful in 21s
wai-quantum for JavaScript / does this change touch it (push) Successful in 22s
wai-sink-swift native sink package / does this change touch it (push) Successful in 21s
wai-sink-android native sink library / does this change touch it (push) Successful in 20s
WAI Studio / does this change touch it (push) Successful in 24s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Has been cancelled
WAI operation catalogue / the catalogue and every door · linux (push) Has been cancelled
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (push) Has been cancelled
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (push) Has been cancelled
joule-code conformance gate / joule-moq-relay, its own energy on a counter (macos) (push) Successful in 43s
joule-moq-remote host agent / joule-moq-remote, every target (macos) (push) Successful in 1m11s
wai-fleet service / service · macos (push) Successful in 1m2s
wai-audit collector and player integration / collector, player integration and the browser end to end · macos (push) Successful in 1m28s
wai-ledger service / service · macos (push) Successful in 1m34s
wai-app and Create / wai-app · Create, browser end-to-end (macos) (push) Successful in 6m8s
wai-quantum studio and desktop / desktop app · macos (push) Successful in 4m12s
WAI Studio / Studio in Chromium and Firefox · macos (push) Successful in 9m11s
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (push) Successful in 11m10s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (push) Successful in 15m15s
wai release binaries build on Windows / the seven release binaries · windows (push) Successful in 16m54s
wai-quantum studio and desktop / desktop app · windows (push) Successful in 10m27s
WAI breaking changes and the conformance runner / WAI breaking · does this change touch WAI (push) Successful in 11s
wai-app and Create / wai-app · tests, clippy, the line language's verifier (linux) (push) Successful in 49s
wai-audit collector and player integration / collector · linux (push) Successful in 1m33s
WAI Studio / the catalogue's actions, the unit tests and the core · linux (push) Successful in 57s
wai-ledger service / service · linux (push) Successful in 1m53s
wai-quantum for JavaScript / javascript · linux (push) Has been cancelled
WAI Studio / Studio in WebKit · linux (push) Has been cancelled
wai-quantum studio and desktop / desktop app · linux (push) Has been cancelled
wai-quantum studio and desktop / studio · browser (push) Has been cancelled
wai-fleet service / service · linux (push) Successful in 4m1s
joule-code conformance gate / Build + round-trip C1-C4 vectors (push) Successful in 5m4s
WAI breaking changes and the conformance runner / WAI breaking · wire, record and API against main · linux (push) Successful in 2m46s
WAI breaking changes and the conformance runner / WAI breaking and conform · their tests, and the independent verifiers through wai conform · linux (push) Successful in 7m20s
joule-moq-remote host agent / joule-moq-remote, every target (linux-arm64) (push) Has been cancelled
joule-moq-room room service / joule-moq-room, every target (push) Has been cancelled
joule-code conformance gate / joule-moq-relay, every target (push) Has been cancelled
joule-code conformance gate / joule-moq-ingest, every target (push) Has been cancelled
One release, four kinds of artefact, from wai-release.yml on a wai-v* tag: - C: each Linux job attaches libwai-<version>-<triple>.tar.gz for x86_64- and aarch64-unknown-linux-gnu (wai/quickstart/build-libwai.sh): lib/libwai.a, the feature native_sink, built for the glibc target without crt-static; the committed include/wai.h; lib/pkgconfig/wai.pc, relocatable, its Libs naming rustc's native-static-libs. Static, so a program carries it and looks for nothing at run time. Before the attach: the header the build regenerates is the committed one, the library defines exactly the envelope's and the native sink's functions, and a C program compiles, links and runs against the archive through pkg-config (wai/quickstart/test/c-library.sh). - Swift: Package.swift names WaiFFI by URL and checksum once a release has written them, and build/WaiFFI.xcframework while it is built there. The swift job attaches the zipped framework and wai-sink-swift-<version>.zip, the package naming it by download URL and SwiftPM checksum; scripts/check-release-package.sh resolves, builds and runs an application against it (before the attach through a mirror of the URL, after from the URL) and requires a wrong checksum to be refused. wai-sink-swift.yml runs the first on every change. - Kotlin: maven-publish as science.transaction.wai:wai-sink:<version>, manifest package science.transaction.wai.sink (the Kotlin classes keep wai.sink). The android job checks the publication (scripts/check-publication.sh), attaches the AAR and publishes it to the forge's Maven registry; wai-sink-android.yml writes and checks it on every change. - OCI: Containerfiles and check-image.sh for the relay and the room service (deploy/ beside each crate). The images job, on a runner labelled oci, builds and checks both and pushes them to the forge's container registry (wai/quickstart/release-images.sh, oci-push.py); an image that fails its check is not pushed. The forge's job token reads the organisation's packages and cannot write them, so the Maven publication and the images read the repository secret WAI_PACKAGES_TOKEN (scope write:package). Every upload goes to the forge over the private network. The release body names the new files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
103 lines
5 KiB
Shell
Executable file
103 lines
5 KiB
Shell
Executable file
#!/usr/bin/env bash
|
|
# The released Swift package as an application uses it (scripts/package-release.sh makes it):
|
|
#
|
|
# scripts/check-release-package.sh <dir> <version> [--local]
|
|
#
|
|
# <dir> holds wai-sink-swift-<version>.zip and WaiFFI-<version>.xcframework.zip. The package is
|
|
# unpacked into a new directory, and an application package beside it that depends on it by path
|
|
# is resolved and built by SwiftPM, which fetches the framework from the URL Package.swift names
|
|
# and checks it against the checksum Package.swift names; the application then runs, and must
|
|
# print the native sink's interface version through the package. Then the same, with one digit of
|
|
# the checksum changed: SwiftPM must refuse to resolve it, saying the checksum does not match.
|
|
# Both must hold.
|
|
#
|
|
# Without --local the framework comes from its URL, as an application gets it (run it after the
|
|
# release has the asset). With --local it comes from <dir> over loopback, through a SwiftPM mirror
|
|
# of that URL, so the package is checked before it is attached; the URL and the checksum are the
|
|
# ones the package names either way. Each run has its own SwiftPM cache, configuration and build
|
|
# directories, so nothing an earlier run fetched is reused.
|
|
set -euo pipefail
|
|
die() { echo "check-release-package: $*" >&2; exit 1; }
|
|
[ $# -ge 2 ] || { echo "usage: scripts/check-release-package.sh <dir> <version> [--local]" >&2; exit 2; }
|
|
DIR=$(cd "$1" && pwd) V="$2" LOCAL="${3:-}"
|
|
PKG="$DIR/wai-sink-swift-$V.zip"
|
|
[ -f "$PKG" ] || die "no $PKG"
|
|
T=$(mktemp -d)
|
|
SERVER=""
|
|
cleanup() {
|
|
# wait gives the server's status, 143 for the TERM it was sent: under set -e, as the trap's
|
|
# last word it would become the script's.
|
|
if [ -n "$SERVER" ]; then kill "$SERVER" 2>/dev/null; wait "$SERVER" 2>/dev/null || true; fi
|
|
rm -rf "$T"
|
|
}
|
|
trap cleanup EXIT
|
|
ditto -x -k "$PKG" "$T/good"
|
|
[ -f "$T/good/wai-sink-swift/Package.swift" ] || die "$PKG holds no wai-sink-swift/Package.swift"
|
|
read -r URL SUM < <(python3 -I - "$T/good/wai-sink-swift/Package.swift" <<'PY'
|
|
import re, sys
|
|
m = re.search(r'let release: \(url: String, checksum: String\)\? = \(url: "([^"]+)", checksum: "([0-9a-f]{64})"\)', open(sys.argv[1]).read())
|
|
print(*(m.groups() if m else ("", "")))
|
|
PY
|
|
)
|
|
[ -n "$URL" ] || die "the package's Package.swift names no release URL and checksum"
|
|
echo "the package names $URL, checksum $SUM"
|
|
|
|
# The same package with the checksum's first digit changed.
|
|
mkdir -p "$T/bad"
|
|
cp -R "$T/good/wai-sink-swift" "$T/bad/"
|
|
BADSUM="$(printf '%x' $(( (0x${SUM:0:1} + 1) % 16 )))${SUM:1}"
|
|
sed -i '' "s/$SUM/$BADSUM/" "$T/bad/wai-sink-swift/Package.swift"
|
|
grep -q "$BADSUM" "$T/bad/wai-sink-swift/Package.swift" || die "the changed checksum was not written"
|
|
|
|
if [ "$LOCAL" = --local ]; then
|
|
ZIP="$DIR/$(basename "$URL")"
|
|
[ -f "$ZIP" ] || die "no $ZIP for the mirror"
|
|
PORT=$(python3 -I -c 'import socket; s=socket.socket(); s.bind(("127.0.0.1", 0)); print(s.getsockname()[1])')
|
|
python3 -I -m http.server --bind 127.0.0.1 --directory "$DIR" "$PORT" > "$T/server.log" 2>&1 &
|
|
SERVER=$!
|
|
for _ in $(seq 1 50); do curl -fsS -o /dev/null "http://127.0.0.1:$PORT/$(basename "$URL")" 2>/dev/null && break; sleep 0.2; done
|
|
fi
|
|
|
|
# An application in <case>/app that uses the package in <case>/wai-sink-swift.
|
|
app() { # <case>
|
|
local c="$T/$1"
|
|
mkdir -p "$c/app/Sources/consumer"
|
|
cat > "$c/app/Package.swift" <<'SWIFT'
|
|
// swift-tools-version:5.9
|
|
import PackageDescription
|
|
|
|
let package = Package(
|
|
name: "consumer",
|
|
platforms: [.macOS(.v13)],
|
|
dependencies: [.package(path: "../wai-sink-swift")],
|
|
targets: [.executableTarget(name: "consumer", dependencies: [.product(name: "WaiSink", package: "wai-sink-swift")])]
|
|
)
|
|
SWIFT
|
|
cat > "$c/app/Sources/consumer/main.swift" <<'SWIFT'
|
|
import WaiSink
|
|
|
|
let abi = WaiSink.abiVersion
|
|
guard abi >= 1 else { fatalError("the native sink's interface version is \(abi)") }
|
|
print("WaiSink: the native sink's interface version \(abi), through the released WaiFFI.xcframework")
|
|
SWIFT
|
|
SPM=(--package-path "$c/app" --scratch-path "$c/build" --cache-path "$c/cache" --config-path "$c/config" --security-path "$c/security")
|
|
if [ -n "$SERVER" ]; then
|
|
swift package "${SPM[@]}" config set-mirror --original "$URL" --mirror "http://127.0.0.1:$PORT/$(basename "$URL")" >/dev/null
|
|
fi
|
|
}
|
|
|
|
app good
|
|
if ! swift build "${SPM[@]}" > "$T/good.log" 2>&1; then
|
|
tail -40 "$T/good.log" >&2
|
|
die "the package does not resolve and build from $URL with its checksum"
|
|
fi
|
|
out=$("$T/good/build/debug/consumer") || die "the application built against the package does not run"
|
|
echo "$out"
|
|
|
|
app bad
|
|
if swift package "${SPM[@]}" resolve > "$T/bad.log" 2>&1; then
|
|
die "SwiftPM resolved the package with a wrong checksum ($BADSUM)"
|
|
fi
|
|
grep -qi "checksum" "$T/bad.log" || { cat "$T/bad.log" >&2; die "SwiftPM refused the wrong checksum, but not for its checksum"; }
|
|
echo "a wrong checksum is refused: $(grep -i -m1 checksum "$T/bad.log" | sed 's/^[[:space:]]*//')"
|
|
echo "check-release-package: wai-sink-swift-$V resolves, builds and runs with its framework from $URL${SERVER:+ (served from $DIR through a mirror of it)}, and refuses a wrong checksum"
|