Skip to content

Commit

Permalink
Merge pull request #113 from zowe-actions/fix/vsce-publish-prerelease4
Browse files Browse the repository at this point in the history
Don't add VSCE to released packages list when publish is skipped
  • Loading branch information
t1m0thyj committed Sep 8, 2023
2 parents 2e00d19 + 303e60d commit 2d61dbd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions dist/vsce.js

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

5 changes: 4 additions & 1 deletion packages/vsce/src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export default async function (context: IContext, config: IPluginConfig): Promis

if (config.vscePublish !== false) {
const vsceMetadata = await utils.vsceInfo(extensionName) || {};
if (!vsceMetadata.versions?.find((obj: any) => obj.version === packageJson.version)) {
if (context.version.prerelease != null) {
// VSCE Marketplace doesn't support prerelease tags: https://github.com/microsoft/vsmarketplace/issues/50
context.logger.warn("Cannot publish version with prerelease tag to VS Code Marketplace");
} else if (!vsceMetadata.versions?.find((obj: any) => obj.version === packageJson.version)) {
await utils.vscePublish(context, vsixPath);

context.releasedPackages.vsce = [
Expand Down
4 changes: 1 addition & 3 deletions packages/vsce/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ export async function vscePublish(context: IContext, vsixPath?: string): Promise
cmdArgs.push("--yarn");
}
if (context.version.prerelease != null) {
// VS Code Marketplace doesn't support prerelease tags: https://github.com/microsoft/vsmarketplace/issues/50
context.logger.warn("Cannot publish version with prerelease tag to VS Code Marketplace");
return;
cmdArgs.push("--pre-release");
}
await utils.dryRunTask(context, `npx ${cmdArgs.join(" ")}`, async () => {
await exec.exec("npx", cmdArgs);
Expand Down

0 comments on commit 2d61dbd

Please sign in to comment.