mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 15:59:30 +00:00
fix(release): guard appcast cleanup before notes path
This commit is contained in:
parent
aea050b43e
commit
abd5fb4494
4 changed files with 28 additions and 1 deletions
|
|
@ -39,9 +39,10 @@ if [[ -z "$VERSION" ]]; then
|
|||
fi
|
||||
|
||||
TMP_DIR="$(mktemp -d)"
|
||||
NOTES_HTML=""
|
||||
cleanup() {
|
||||
rm -rf "$TMP_DIR"
|
||||
if [[ "${KEEP_SPARKLE_NOTES:-0}" != "1" ]]; then
|
||||
if [[ -n "$NOTES_HTML" && "${KEEP_SPARKLE_NOTES:-0}" != "1" ]]; then
|
||||
rm -f "$NOTES_HTML"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -737,6 +737,7 @@ const TOOLING_SOURCE_TEST_TARGETS = new Map([
|
|||
["scripts/ios-run.sh", ["test/scripts/ios-run.test.ts"]],
|
||||
["scripts/create-dmg.sh", ["test/scripts/create-dmg.test.ts"]],
|
||||
["scripts/kova-ci-summary.mjs", ["test/scripts/kova-ci-summary.test.ts"]],
|
||||
["scripts/make_appcast.sh", ["test/scripts/make-appcast.test.ts"]],
|
||||
["scripts/openclaw-npm-postpublish-verify.ts", ["test/openclaw-npm-postpublish-verify.test.ts"]],
|
||||
["scripts/openclaw-npm-release-check.ts", ["test/openclaw-npm-release-check.test.ts"]],
|
||||
["scripts/openclaw-prepack.ts", ["test/openclaw-prepack.test.ts"]],
|
||||
|
|
|
|||
24
test/scripts/make-appcast.test.ts
Normal file
24
test/scripts/make-appcast.test.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// Make Appcast tests cover release appcast script behavior.
|
||||
import { readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const scriptPath = "scripts/make_appcast.sh";
|
||||
|
||||
describe("make_appcast cleanup", () => {
|
||||
it("does not reference release notes before their path is assigned", () => {
|
||||
const script = readFileSync(scriptPath, "utf8");
|
||||
const setupBlock = script.slice(
|
||||
script.indexOf('TMP_DIR="$(mktemp -d)"'),
|
||||
script.indexOf('cp -f "$ZIP" "$TMP_DIR/$ZIP_NAME"'),
|
||||
);
|
||||
|
||||
expect(setupBlock).toContain('NOTES_HTML=""');
|
||||
expect(setupBlock.indexOf('NOTES_HTML=""')).toBeLessThan(
|
||||
setupBlock.indexOf("trap cleanup EXIT"),
|
||||
);
|
||||
expect(setupBlock).toContain(
|
||||
'if [[ -n "$NOTES_HTML" && "${KEEP_SPARKLE_NOTES:-0}" != "1" ]]; then',
|
||||
);
|
||||
expect(setupBlock).toContain('rm -f "$NOTES_HTML"');
|
||||
});
|
||||
});
|
||||
|
|
@ -1184,6 +1184,7 @@ describe("scripts/test-projects changed-target routing", () => {
|
|||
],
|
||||
["scripts/ios-run.sh", ["test/scripts/ios-run.test.ts"]],
|
||||
["scripts/create-dmg.sh", ["test/scripts/create-dmg.test.ts"]],
|
||||
["scripts/make_appcast.sh", ["test/scripts/make-appcast.test.ts"]],
|
||||
["scripts/package-mac-app.sh", ["test/scripts/package-mac-app.test.ts"]],
|
||||
["scripts/package-mac-dist.sh", ["test/scripts/package-mac-dist.test.ts"]],
|
||||
["scripts/package-changelog.mjs", ["test/scripts/package-changelog.test.ts"]],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue