Skip to content

Commit 30b3b6e

Browse files
authored
fix: add verify flag (#218)
1 parent 8efbe84 commit 30b3b6e

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

command-snapshot.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
{
4444
"command": "npm:lerna:release",
4545
"plugin": "@salesforce/plugin-release-management",
46-
"flags": ["dryrun", "githubrelease", "install", "json", "loglevel", "npmaccess", "npmtag", "sign"]
46+
"flags": ["dryrun", "githubrelease", "install", "json", "loglevel", "npmaccess", "npmtag", "sign", "verify"]
4747
},
4848
{
4949
"command": "npm:package:promote",
@@ -53,7 +53,7 @@
5353
{
5454
"command": "npm:package:release",
5555
"plugin": "@salesforce/plugin-release-management",
56-
"flags": ["dryrun", "install", "json", "loglevel", "npmaccess", "npmtag", "prerelease", "sign"]
56+
"flags": ["dryrun", "install", "json", "loglevel", "npmaccess", "npmtag", "prerelease", "sign", "verify"]
5757
},
5858
{
5959
"command": "npm:release:validate",

messages/npm.lerna.release.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"npmAccess": "access level to use when publishing to npm",
77
"install": "run yarn install and build on repository",
88
"githubRelease": "create release in github based on the package changes",
9+
"verify": "verify npm registry has new version after publish and digital signature",
910
"InvalidNextVersion": "%s already exists in the public npm registry",
1011
"MissingDependencies": "Missing requred environment variables or utilites",
1112
"InvalidRepoType": "Cannot run this command on a non-monorepo. Use sfdx npm:package:release instead.",

messages/npm.package.release.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"npmAccess": "access level to use when publishing to npm",
77
"install": "run yarn install and build on repository",
88
"prerelease": "determine the next version as <version>-<prerelease>.0 if version is not manually set",
9+
"verify": "verify npm registry has new version after publish and digital signature",
910
"InvalidNextVersion": "%s already exists in the public npm registry",
1011
"MissingDependencies": "Missing requred environment variables or utilites",
1112
"InvalidRepoType": "Cannot run this command on a monorepo. Use sfdx npm:monorepo:release instead."

src/commands/npm/lerna/release.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export default class Release extends SfdxCommand {
5252
default: false,
5353
description: messages.getMessage('githubRelease'),
5454
}),
55+
verify: flags.boolean({
56+
description: messages.getMessage('verify'),
57+
default: true,
58+
allowNo: true,
59+
}),
5560
};
5661

5762
public async run(): Promise<ReleaseResult[]> {
@@ -126,15 +131,15 @@ export default class Release extends SfdxCommand {
126131
dryrun: this.flags.dryrun as boolean,
127132
});
128133

129-
if (!this.flags.dryrun) {
134+
if (!this.flags.dryrun && this.flags.verify) {
130135
lernaRepo.printStage('Waiting For Availablity');
131136
const found = await lernaRepo.waitForAvailability();
132137
if (!found) {
133138
this.ux.warn('Exceeded timeout waiting for packages to become available');
134139
}
135140
}
136141

137-
if (this.flags.sign && !this.flags.dryrun) {
142+
if (this.flags.sign && this.flags.verify && !this.flags.dryrun) {
138143
lernaRepo.printStage('Verify Signed Packaged');
139144
lernaRepo.verifySignature(this.flags.sign);
140145
}

src/commands/npm/package/release.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ export default class Release extends SfdxCommand {
5050
prerelease: flags.string({
5151
description: messages.getMessage('prerelease'),
5252
}),
53+
verify: flags.boolean({
54+
description: messages.getMessage('verify'),
55+
default: true,
56+
allowNo: true,
57+
}),
5358
};
5459

5560
public async run(): Promise<ReleaseResult> {
@@ -115,15 +120,15 @@ export default class Release extends SfdxCommand {
115120
dryrun: this.flags.dryrun as boolean,
116121
});
117122

118-
if (!this.flags.dryrun) {
123+
if (!this.flags.dryrun && this.flags.verify) {
119124
pkg.printStage('Waiting For Availability');
120125
const found = await pkg.waitForAvailability();
121126
if (!found) {
122127
this.ux.warn(`Exceeded timeout waiting for ${pkg.name}@${pkg.nextVersion} to become available`);
123128
}
124129
}
125130

126-
if (this.flags.sign && !this.flags.dryrun) {
131+
if (this.flags.sign && this.flags.verify && !this.flags.dryrun) {
127132
pkg.printStage('Verify Signed Packaged');
128133
pkg.verifySignature();
129134
}

0 commit comments

Comments
 (0)