Skip to content

Commit f7ada28

Browse files
committed
only require publisher for mongosh and delete after merge
1 parent d7cdb40 commit f7ada28

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/build/src/npm-packages/publish.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ export function publishToNpm(
2424
spawnSync: typeof spawnSyncFn = spawnSyncFn
2525
): Promise<void> {
2626
const publisher = process.env.MONGOSH_RELEASE_PUBLISHER;
27-
if (!publisher) {
28-
throw new Error('MONGOSH_RELEASE_PUBLISHER not specified for publishing');
27+
if (!publisher && !useAuxiliaryPackagesOnly) {
28+
throw new Error(
29+
'MONGOSH_RELEASE_PUBLISHER not specified for publishing mongosh release'
30+
);
2931
}
3032

3133
const commandOptions: SpawnSyncOptionsWithStringEncoding = {
@@ -99,6 +101,13 @@ export function publishToNpm(
99101
commandOptions
100102
);
101103
spawnSync('git', ['push', 'origin', 'main'], commandOptions);
104+
105+
// Delete the release branch after merging
106+
spawnSync(
107+
'git',
108+
['branch', '-D', `release/${mongoshVersion}`],
109+
commandOptions
110+
);
102111
}
103112
}
104113

0 commit comments

Comments
 (0)