dist: use resolve_artifact for strict release-artifact selection
Replace `sh("ls -t <glob> | head -1")` guarded on an empty string with
Bento's resolve_artifact / resolve_artifact_opt: exactly-one match for the
required AppImage/dmg, zero-or-one for the optional deb, and a hard error on
an ambiguous match instead of a stale newest-by-mtime pick.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 files changed,
+3 insertions,
-5 deletions
| 25 |
25 |
|
sh_ok(h, "cd " + r + " && ./dist/build-deb.sh");
|
| 26 |
26 |
|
|
| 27 |
27 |
|
step("collect");
|
| 28 |
|
- |
let appimage = sh(h, "ls -t " + r + "/dist/*.AppImage | head -1").stdout_tail.trim();
|
| 29 |
|
- |
if appimage == "" { throw "no .AppImage produced for " + target(); }
|
|
28 |
+ |
let appimage = resolve_artifact(h, r + "/dist/*.AppImage");
|
| 30 |
29 |
|
collect(h, appimage, "audiofiles", v);
|
| 31 |
|
- |
let deb = sh(h, "ls -t " + r + "/dist/*.deb 2>/dev/null | head -1").stdout_tail.trim();
|
|
30 |
+ |
let deb = resolve_artifact_opt(h, r + "/dist/*.deb");
|
| 32 |
31 |
|
if deb != "" { collect(h, deb, "audiofiles", v); }
|
| 33 |
32 |
|
log("audiofiles " + target() + " v" + v + " collected.");
|
| 27 |
27 |
|
|
| 28 |
28 |
|
// DMG name uses `uname -m` (arm64), not the target arch slug — resolve it.
|
| 29 |
29 |
|
step("verify");
|
| 30 |
|
- |
let dmg = sh(h, "ls -t " + r + "/dist/Audiofiles_*.dmg | head -1").stdout_tail.trim();
|
| 31 |
|
- |
if dmg == "" { throw "no .dmg produced under dist/"; }
|
|
30 |
+ |
let dmg = resolve_artifact(h, r + "/dist/Audiofiles_*.dmg");
|
| 32 |
31 |
|
if !verify_gatekeeper(h, dmg) {
|
| 33 |
32 |
|
throw "DMG is not Gatekeeper-accepted as Notarized Developer ID: " + dmg;
|
| 34 |
33 |
|
}
|