build: archive plain bundle sources without git

This commit is contained in:
2026-11-11 22:52:53 +00:00
parent 68a4e5ff8e
commit 7c4f078f38
+2 -4
View File
@@ -13,9 +13,7 @@ def main [destination?: path] {
let manifest = ($here | path join .. Cargo.toml)
let metadata = (^cargo metadata --manifest-path $manifest --no-deps --format-version 1 | from json)
let packages = ($metadata.packages | where {|p|
$p.id in $metadata.workspace_members and
($p.manifest_path | str starts-with $here) and
not ($p.manifest_path | str starts-with ($here | path join brush source))
($p.id in $metadata.workspace_members) and ($p.manifest_path | str starts-with $here) and not ($p.manifest_path | str starts-with ($here | path join brush source))
})
let arguments = ($packages | where {|p| $p.targets | any {|t| 'bin' in $t.kind } } | each {|p| ['-p' $p.name] } | flatten)
do { cd $here; ^cargo build --manifest-path $manifest --release --locked --target wasm32-wasip2 ...$arguments }
@@ -51,7 +49,7 @@ def main [destination?: path] {
if ($snapshot | path exists) { rm --recursive --force $snapshot }
mkdir $snapshot
let archive = ($destination | path join source.tar)
^git -C $repo archive --output $archive HEAD host vfs userland config skills extensions Cargo.toml Cargo.lock flake.nix flake.lock README.md AGENTS.md .gitignore
^tar --exclude-vcs --exclude-vcs-ignores -cf $archive -C $repo host vfs userland config skills extensions Cargo.toml Cargo.lock flake.nix flake.lock README.md AGENTS.md .gitignore
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'source archive failed'} }
^tar -xf $archive -C $snapshot
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'source extraction failed'} }