From ea9f5335360617ff59dbb4a695116c445826d42f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 19 Jul 2023 15:28:19 +0200 Subject: [PATCH] [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. --- tools/release.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/release.js b/tools/release.js index f43a81b3..0ec4bb2c 100644 --- a/tools/release.js +++ b/tools/release.js @@ -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");