Skip to content

Commit

Permalink
Merge pull request #106 from zowe-actions/fix/vsce-publish-prerelease
Browse files Browse the repository at this point in the history
Support prerelease flag for publishing VSIXs
  • Loading branch information
t1m0thyj committed Aug 18, 2023
2 parents 6796f97 + 1ab8df7 commit 3c5ec88
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/update-tag.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions dist/run-script.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions dist/vsce.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/run-script/scripts/npmUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ function getDependencies(context: IContext, branch: IProtectedBranchWithDeps, de

async function updateDependency(context: IContext, pkgName: string, pkgTag: string, dev: boolean): Promise<void> {
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}`);
Expand Down
6 changes: 6 additions & 0 deletions packages/vsce/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand All @@ -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);
});
Expand Down

0 comments on commit 3c5ec88

Please sign in to comment.