diff --git a/.github/workflows/update-tag.yml b/.github/workflows/update-tag.yml new file mode 100644 index 0000000..b354861 --- /dev/null +++ b/.github/workflows/update-tag.yml @@ -0,0 +1,11 @@ +name: Update latest tag + +on: + push: + tags: ["v*"] + +jobs: + update-tag: + runs-on: ubuntu-latest + steps: + - uses: nowactions/update-majorver@main diff --git a/dist/run-script.js b/dist/run-script.js index e61da33..8dfc445 100644 --- a/dist/run-script.js +++ b/dist/run-script.js @@ -3673,8 +3673,8 @@ function getDependencies(context3, branch, dev) { function updateDependency(context3, pkgName, pkgTag, dev) { return __async(this, null, function* () { context3.logger.debug(`Updating ${dev ? "devD" : "d"}ependency for: ${pkgName}@${pkgTag}`); - const lockfile = JSON.parse(fs.readFileSync(lockfilePath, "utf-8")); - const currentVersion = lockfile.dependencies[pkgName].version; + const cmdOutput = (yield exec.getExecOutput("npm", ["list", pkgName, "--json", "--depth", "0"])).stdout; + const currentVersion = JSON.parse(cmdOutput).dependencies[pkgName].version; if (resolutions[pkgName] == null) { context3.logger.debug(`Gathering version information for: ${pkgName}@${pkgTag}`); resolutions[pkgName] = (yield exec.getExecOutput( diff --git a/dist/vsce.js b/dist/vsce.js index e5cbb7b..d0da2a6 100644 --- a/dist/vsce.js +++ b/dist/vsce.js @@ -1149,6 +1149,9 @@ function ovsxPublish(context, vsixPath) { } else if (fs.existsSync(path.join(context.rootDir, "yarn.lock"))) { cmdArgs.push("--yarn"); } + if (context.version.prerelease != null) { + cmdArgs.push("--pre-release"); + } yield import_core.utils.dryRunTask(context, `npx ${cmdArgs.join(" ")}`, () => __async(this, null, function* () { yield exec.exec("npx", cmdArgs); })); @@ -1179,6 +1182,9 @@ function vscePublish(context, vsixPath) { } else if (fs.existsSync(path.join(context.rootDir, "yarn.lock"))) { cmdArgs.push("--yarn"); } + if (context.version.prerelease != null) { + cmdArgs.push("--pre-release"); + } yield import_core.utils.dryRunTask(context, `npx ${cmdArgs.join(" ")}`, () => __async(this, null, function* () { yield exec.exec("npx", cmdArgs); })); diff --git a/packages/run-script/scripts/npmUpdate.ts b/packages/run-script/scripts/npmUpdate.ts index d0916e7..27d9ea9 100644 --- a/packages/run-script/scripts/npmUpdate.ts +++ b/packages/run-script/scripts/npmUpdate.ts @@ -46,8 +46,8 @@ function getDependencies(context: IContext, branch: IProtectedBranchWithDeps, de async function updateDependency(context: IContext, pkgName: string, pkgTag: string, dev: boolean): Promise { context.logger.debug(`Updating ${dev ? "devD" : "d"}ependency for: ${pkgName}@${pkgTag}`); - const lockfile = JSON.parse(fs.readFileSync(lockfilePath, "utf-8")); - const currentVersion = lockfile.dependencies[pkgName].version; + const cmdOutput = (await exec.getExecOutput("npm", ["list", pkgName, "--json", "--depth", "0"])).stdout; + const currentVersion = JSON.parse(cmdOutput).dependencies[pkgName].version; if (resolutions[pkgName] == null) { context.logger.debug(`Gathering version information for: ${pkgName}@${pkgTag}`); diff --git a/packages/vsce/src/utils.ts b/packages/vsce/src/utils.ts index 3a4e4e1..a3b85a1 100644 --- a/packages/vsce/src/utils.ts +++ b/packages/vsce/src/utils.ts @@ -31,6 +31,9 @@ export async function ovsxPublish(context: IContext, vsixPath?: string): Promise } else if (fs.existsSync(path.join(context.rootDir, "yarn.lock"))) { cmdArgs.push("--yarn"); } + if (context.version.prerelease != null) { + cmdArgs.push("--pre-release"); + } await utils.dryRunTask(context, `npx ${cmdArgs.join(" ")}`, async () => { await exec.exec("npx", cmdArgs); }); @@ -57,6 +60,9 @@ export async function vscePublish(context: IContext, vsixPath?: string): Promise } else if (fs.existsSync(path.join(context.rootDir, "yarn.lock"))) { cmdArgs.push("--yarn"); } + if (context.version.prerelease != null) { + cmdArgs.push("--pre-release"); + } await utils.dryRunTask(context, `npx ${cmdArgs.join(" ")}`, async () => { await exec.exec("npx", cmdArgs); });