Skip to content

Commit 8d4aed2

Browse files
authored
fix(ci): add bump step to compile_ts and compile_artifact (#2340)
Beyond making sure the directory is bumped when releasing, we also want to be sure we have our versions bumped when compiling artifacts.
1 parent a6c7ab4 commit 8d4aed2

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

.evergreen.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ functions:
172172
set -e
173173
{
174174
source .evergreen/setup-env.sh
175+
npm run evergreen-release bump
175176
npm run check-ci
176177
}
177178
test:

.evergreen/compile-artifact.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ elif [ -n "$MONGOSH_SHARED_OPENSSL" ]; then
7575
fi
7676

7777
export PUPPETEER_SKIP_DOWNLOAD="true"
78+
npm run evergreen-release bump
7879
npm run evergreen-release compile
7980
dist/mongosh --version
8081
dist/mongosh --build-info

.evergreen/evergreen.yml.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ functions:
181181
set -e
182182
{
183183
source .evergreen/setup-env.sh
184+
npm run evergreen-release bump
184185
npm run check-ci
185186
}
186187
test:

packages/build/src/npm-packages/bump.spec.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@ describe('npm-packages bump', function () {
2525
});
2626

2727
describe('bumpMongoshReleasePackages', function () {
28-
it('throws if version is not set', async function () {
29-
try {
30-
await bumpMongoshReleasePackages('');
31-
expect.fail('did not error');
32-
} catch (error) {
33-
expect(error).instanceOf(Error);
34-
expect((error as Error).message).equals(
35-
'version not specified during mongosh bump'
36-
);
37-
}
28+
it('warns and does not run if version is not set', async function () {
29+
const consoleWarnSpy = sinon.spy(console, 'warn');
30+
await bumpMongoshReleasePackages('');
31+
expect(consoleWarnSpy).calledOnceWith(
32+
'mongosh: Release version not specified. Skipping mongosh bump.'
33+
);
34+
expect(fsReadFile).not.called;
35+
expect(fsWriteFile).not.called;
36+
consoleWarnSpy.restore();
3837
});
3938
});
4039

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export async function bumpMongoshReleasePackages(
1414
version: string
1515
): Promise<void> {
1616
if (!version) {
17-
throw new Error('version not specified during mongosh bump');
17+
console.warn(
18+
'mongosh: Release version not specified. Skipping mongosh bump.'
19+
);
20+
return;
1821
}
1922

2023
console.info(`mongosh: Bumping mongosh release packages to ${version}`);

0 commit comments

Comments
 (0)