Skip to content

Commit d4d7980

Browse files
authored
chore(ci): align package bump commits (#2385)
Currently we bump packages with 2 different commit messages: "bump auxiliary packages" during an auxiliary and "bump packages" during a mongosh release. The problem is the auxiliary bump looks for commits messages starting with "..bump auxiliary packages" and thus ignores already released changes if they were made during a mongosh release. To align this while also differentiating them for the purpose of the auxiliary publishing workflow, these commits will now both starts with ".. bump packages" and instead have different ending "for mongosh release" or "for auxiliary release"
1 parent 93a7bc6 commit d4d7980

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

.github/workflows/bump-auxiliary-packages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ jobs:
4242
run: |
4343
npm run bump-auxiliary
4444
git add .
45-
git commit --no-allow-empty -m "chore(release): bump auxiliary packages" || true
45+
git commit --no-allow-empty -m "chore(release): bump packages for auxiliary release" || true
4646
4747
- name: Create Pull Request
4848
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5
4949
with:
5050
token: ${{ steps.app-token.outputs.token }}
51-
commit-message: "chore(release): bump auxiliary packages"
51+
commit-message: "chore(release): bump packages for auxiliary release"
5252
branch: ci/bump-auxiliary-packages
53-
title: "chore(release): bump auxiliary packages"
53+
title: "chore(release): bump packages for auxiliary release"
5454
labels: no-title-validation
5555
body: |
5656
- Bumps auxiliary package versions. Merging will trigger a release of these packages.

.github/workflows/publish-auxiliary-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
publish:
1717
if: |
1818
github.event_name == 'workflow_dispatch' ||
19-
startsWith(github.event.head_commit.message, 'chore(release): bump auxiliary packages')
19+
startsWith(github.event.head_commit.message, 'chore(release): bump packages for auxiliary release')
2020
2121
runs-on: ubuntu-latest
2222
environment: Production

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

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function bumpAuxiliaryPackages() {
110110
encoding: 'utf8',
111111
env: {
112112
...process.env,
113-
LAST_BUMP_COMMIT_MESSAGE: 'chore(release): bump auxiliary packages',
113+
LAST_BUMP_COMMIT_MESSAGE: 'chore(release): bump packages',
114114
SKIP_BUMP_PACKAGES: [
115115
...EXCLUDE_RELEASE_PACKAGES,
116116
...MONGOSH_RELEASE_PACKAGES,
@@ -120,6 +120,7 @@ export function bumpAuxiliaryPackages() {
120120
}
121121

122122
export function commitBumpedPackages(
123+
{ useAuxiliaryPackagesOnly }: { useAuxiliaryPackagesOnly: boolean },
123124
spawnSync: typeof spawnSyncFn = spawnSyncFn
124125
) {
125126
spawnSync('git', ['add', '.'], {
@@ -128,9 +129,19 @@ export function commitBumpedPackages(
128129
encoding: 'utf8',
129130
});
130131

131-
spawnSync('git', ['commit', '-m', 'chore(release): bump packages'], {
132-
stdio: 'inherit',
133-
cwd: PROJECT_ROOT,
134-
encoding: 'utf8',
135-
});
132+
spawnSync(
133+
'git',
134+
[
135+
'commit',
136+
'-m',
137+
`chore(release): bump packages for ${
138+
useAuxiliaryPackagesOnly ? 'auxiliary' : 'mongosh'
139+
} release`,
140+
],
141+
{
142+
stdio: 'inherit',
143+
cwd: PROJECT_ROOT,
144+
encoding: 'utf8',
145+
}
146+
);
136147
}

packages/build/src/publish-mongosh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export async function publishMongosh(
7070

7171
bumpAuxiliaryPackages();
7272
await bumpMongoshReleasePackages(releaseVersion);
73-
commitBumpedPackages(spawnSync);
73+
commitBumpedPackages({ useAuxiliaryPackagesOnly: false }, spawnSync);
7474
pushTags({
7575
useAuxiliaryPackagesOnly: false,
7676
isDryRun: config.isDryRun || false,

0 commit comments

Comments
 (0)