Wire Forge-native release infrastructure
Some checks failed
Cache: Publish Nix / Publish Nix Cache (push) Waiting to run
Build Rust / Cargo Test (push) Successful in 4m14s
Build Site / Next.js Build (push) Failing after 6s
Infra: OpenTofu / OpenTofu (grafana) (push) Successful in 5s
Lint Governance / BEP Metadata (push) Successful in 0s
Build: Android / Android Rust Core Stub (push) Failing after 23s
Some checks failed
Cache: Publish Nix / Publish Nix Cache (push) Waiting to run
Build Rust / Cargo Test (push) Successful in 4m14s
Build Site / Next.js Build (push) Failing after 6s
Infra: OpenTofu / OpenTofu (grafana) (push) Successful in 5s
Lint Governance / BEP Metadata (push) Successful in 0s
Build: Android / Android Rust Core Stub (push) Failing after 23s
This commit is contained in:
parent
97c569fb35
commit
002bd382e9
199 changed files with 14268 additions and 185 deletions
14
bazel/android/BUILD.bazel
Normal file
14
bazel/android/BUILD.bazel
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
|
||||
load(":android_targets.bzl", "android_stub_stamp")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
sh_binary(
|
||||
name = "runner",
|
||||
srcs = ["runner.sh"],
|
||||
)
|
||||
|
||||
android_stub_stamp(
|
||||
name = "check_stub_stamp",
|
||||
command = "check-stub",
|
||||
)
|
||||
12
bazel/android/android_targets.bzl
Normal file
12
bazel/android/android_targets.bzl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
def android_stub_stamp(name, command):
|
||||
native.genrule(
|
||||
name = name,
|
||||
outs = [name + ".stamp"],
|
||||
cmd = "$(location :runner) %s && : > \"$@\"" % command,
|
||||
srcs = [
|
||||
"//:android_project_files",
|
||||
"//:mobile_rust_core_files",
|
||||
],
|
||||
tools = [":runner"],
|
||||
tags = ["no-sandbox"],
|
||||
)
|
||||
73
bazel/android/runner.sh
Executable file
73
bazel/android/runner.sh
Executable file
|
|
@ -0,0 +1,73 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
command="${1:-}"
|
||||
|
||||
resolve_repo_root() {
|
||||
if [[ -n "${BUILD_WORKSPACE_DIRECTORY:-}" && -f "${BUILD_WORKSPACE_DIRECTORY}/MODULE.bazel" ]]; then
|
||||
printf '%s\n' "$BUILD_WORKSPACE_DIRECTORY"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local dir="$PWD"
|
||||
while [[ "$dir" != "/" ]]; do
|
||||
if [[ -f "$dir/MODULE.bazel" && -d "$dir/Android" ]]; then
|
||||
printf '%s\n' "$dir"
|
||||
return 0
|
||||
fi
|
||||
dir="$(dirname "$dir")"
|
||||
done
|
||||
|
||||
echo "unable to resolve Burrow repository root" >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
repo_root="$(resolve_repo_root)"
|
||||
cd "$repo_root"
|
||||
|
||||
cargo_check_locked() {
|
||||
local -a cargo_path_prefixes
|
||||
local home_dir user_name
|
||||
cargo_path_prefixes=()
|
||||
home_dir="${HOME:-}"
|
||||
if [[ -n "$home_dir" ]]; then
|
||||
cargo_path_prefixes+=("$home_dir/.cargo/bin")
|
||||
fi
|
||||
user_name="$(id -un 2>/dev/null || true)"
|
||||
if [[ -n "$user_name" ]]; then
|
||||
cargo_path_prefixes+=(
|
||||
"/Users/${user_name}/.cargo/bin"
|
||||
"/home/${user_name}/.cargo/bin"
|
||||
"/etc/profiles/per-user/${user_name}/bin"
|
||||
)
|
||||
fi
|
||||
cargo_path_prefixes+=("/opt/homebrew/bin" "/usr/local/bin" "/nix/var/nix/profiles/default/bin" "/run/current-system/sw/bin")
|
||||
export PATH="$(IFS=:; printf '%s' "${cargo_path_prefixes[*]}"):$PATH"
|
||||
|
||||
if command -v cargo >/dev/null 2>&1; then
|
||||
cargo check --locked -p burrow-mobile-ffi
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ "${BURROW_ANDROID_BAZEL_USE_NIX:-0}" == "1" ]] && command -v nix >/dev/null 2>&1; then
|
||||
nix develop .#ci -c cargo check --locked -p burrow-mobile-ffi
|
||||
return
|
||||
fi
|
||||
|
||||
echo "cargo or nix is required to check the Android Rust core stub" >&2
|
||||
exit 127
|
||||
}
|
||||
|
||||
case "$command" in
|
||||
check-stub)
|
||||
test -f Android/settings.gradle.kts
|
||||
test -f Android/app/src/main/java/net/burrow/android/MainActivity.kt
|
||||
test -f crates/burrow-core/src/lib.rs
|
||||
test -f crates/burrow-mobile-ffi/src/lib.rs
|
||||
cargo_check_locked
|
||||
;;
|
||||
*)
|
||||
echo "unknown Android runner command: ${command}" >&2
|
||||
exit 64
|
||||
;;
|
||||
esac
|
||||
25
bazel/apple/BUILD.bazel
Normal file
25
bazel/apple/BUILD.bazel
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
|
||||
load(":apple_targets.bzl", "apple_bazel_stamp")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
sh_binary(
|
||||
name = "runner",
|
||||
srcs = ["runner.sh"],
|
||||
target_compatible_with = ["@platforms//os:macos"],
|
||||
)
|
||||
|
||||
apple_bazel_stamp(
|
||||
name = "release_ios_stamp",
|
||||
command = "release-ios",
|
||||
)
|
||||
|
||||
apple_bazel_stamp(
|
||||
name = "release_macos_stamp",
|
||||
command = "release-macos",
|
||||
)
|
||||
|
||||
apple_bazel_stamp(
|
||||
name = "release_all_stamp",
|
||||
command = "release-all",
|
||||
)
|
||||
13
bazel/apple/apple_targets.bzl
Normal file
13
bazel/apple/apple_targets.bzl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
def apple_bazel_stamp(name, command):
|
||||
native.genrule(
|
||||
name = name,
|
||||
outs = [name + ".stamp"],
|
||||
cmd = "$(location :runner) %s && : > \"$@\"" % command,
|
||||
srcs = ["//:apple_project_files"],
|
||||
tools = [":runner"],
|
||||
# The Xcode script stages release artifacts under dist/builds as a
|
||||
# deliberate CI side effect; keep the wrapper uncached so the staging
|
||||
# step always runs in fresh and reused workspaces.
|
||||
tags = ["no-cache", "no-remote-cache", "no-sandbox"],
|
||||
target_compatible_with = ["@platforms//os:macos"],
|
||||
)
|
||||
42
bazel/apple/runner.sh
Executable file
42
bazel/apple/runner.sh
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
command="${1:-}"
|
||||
|
||||
resolve_repo_root() {
|
||||
if [[ -n "${BUILD_WORKSPACE_DIRECTORY:-}" && -f "${BUILD_WORKSPACE_DIRECTORY}/MODULE.bazel" ]]; then
|
||||
printf '%s\n' "$BUILD_WORKSPACE_DIRECTORY"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local dir="$PWD"
|
||||
while [[ "$dir" != "/" ]]; do
|
||||
if [[ -f "$dir/MODULE.bazel" && -d "$dir/Apple" ]]; then
|
||||
printf '%s\n' "$dir"
|
||||
return 0
|
||||
fi
|
||||
dir="$(dirname "$dir")"
|
||||
done
|
||||
|
||||
echo "unable to resolve Burrow repository root" >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
repo_root="$(resolve_repo_root)"
|
||||
cd "$repo_root"
|
||||
|
||||
case "$command" in
|
||||
release-ios)
|
||||
Scripts/ci/package-apple-artifacts.sh ios
|
||||
;;
|
||||
release-macos)
|
||||
Scripts/ci/package-apple-artifacts.sh macos
|
||||
;;
|
||||
release-all)
|
||||
Scripts/ci/package-apple-artifacts.sh all
|
||||
;;
|
||||
*)
|
||||
echo "unknown apple runner command: ${command}" >&2
|
||||
exit 64
|
||||
;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue