[FIX] tools: include proper version number in released build

Before this commit, the release script would build the code, then update
the version number, so the released code would have the previous release
number instead of the current.
This commit is contained in:
Géry Debongnie
2023-07-19 15:28:19 +02:00
committed by Sam Degueldre
parent 875ebdcfb0
commit ea9f533536
+6 -7
View File
@@ -82,6 +82,12 @@ async function startRelease() {
return;
}
// ---------------------------------------------------------------------------
log(`Step ${step++}/${STEPS}: updating package.json...`);
await writeFile("package.json", JSON.stringify({...package, version: next}, null, 2) + "\n");
await writeFile("package-lock.json", JSON.stringify({...packageLock, version: next}, null, 2) + "\n");
await writeFile("./src/version.ts", `// do not modify manually. This file is generated by the release script.\nexport const version = "${next}";\n`);
// ---------------------------------------------------------------------------
log(`Step ${step++}/${STEPS}: building owl...`);
await execCommand("rm -rf dist/");
@@ -108,13 +114,6 @@ async function startRelease() {
await execCommand("cd dist && zip -r owl-devtools.zip devtools-chrome devtools-firefox && cd ..");
await execCommand("rm -r dist/devtools-chrome dist/devtools-firefox && rm dist/compiler.js");
// ---------------------------------------------------------------------------
log(`Step ${step++}/${STEPS}: updating package.json...`);
await writeFile("package.json", JSON.stringify({...package, version: next}, null, 2) + "\n");
await writeFile("package-lock.json", JSON.stringify({...packageLock, version: next}, null, 2) + "\n");
await writeFile("./src/version.ts", `// do not modify manually. This file is generated by the release script.\nexport const version = "${next}";\n`);
// ---------------------------------------------------------------------------
log(`Step ${step++}/${STEPS}: updating owl on github page...`);
await fs.copyFileSync("dist/owl.es.js", "docs/owl.js");