Skip to content

Commit

Permalink
fix(ci): add bump step to compile_ts and compile_artifact (#2340)
Browse files Browse the repository at this point in the history
Beyond making sure the directory is bumped  when releasing, we also want to be sure we have our versions bumped when compiling artifacts.
  • Loading branch information
gagik authored Jan 31, 2025
1 parent a6c7ab4 commit 8d4aed2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ functions:
set -e
{
source .evergreen/setup-env.sh
npm run evergreen-release bump
npm run check-ci
}
test:
Expand Down
1 change: 1 addition & 0 deletions .evergreen/compile-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ elif [ -n "$MONGOSH_SHARED_OPENSSL" ]; then
fi

export PUPPETEER_SKIP_DOWNLOAD="true"
npm run evergreen-release bump
npm run evergreen-release compile
dist/mongosh --version
dist/mongosh --build-info
Expand Down
1 change: 1 addition & 0 deletions .evergreen/evergreen.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ functions:
set -e
{
source .evergreen/setup-env.sh
npm run evergreen-release bump
npm run check-ci
}
test:
Expand Down
19 changes: 9 additions & 10 deletions packages/build/src/npm-packages/bump.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ describe('npm-packages bump', function () {
});

describe('bumpMongoshReleasePackages', function () {
it('throws if version is not set', async function () {
try {
await bumpMongoshReleasePackages('');
expect.fail('did not error');
} catch (error) {
expect(error).instanceOf(Error);
expect((error as Error).message).equals(
'version not specified during mongosh bump'
);
}
it('warns and does not run if version is not set', async function () {
const consoleWarnSpy = sinon.spy(console, 'warn');
await bumpMongoshReleasePackages('');
expect(consoleWarnSpy).calledOnceWith(
'mongosh: Release version not specified. Skipping mongosh bump.'
);
expect(fsReadFile).not.called;
expect(fsWriteFile).not.called;
consoleWarnSpy.restore();
});
});

Expand Down
5 changes: 4 additions & 1 deletion packages/build/src/npm-packages/bump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export async function bumpMongoshReleasePackages(
version: string
): Promise<void> {
if (!version) {
throw new Error('version not specified during mongosh bump');
console.warn(
'mongosh: Release version not specified. Skipping mongosh bump.'
);
return;
}

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

0 comments on commit 8d4aed2

Please sign in to comment.