Skip to content

Commit 435d4ce

Browse files
authored
chore(ci): add individual publishing of packages MONGOSH-1871 (#2289)
1 parent f0f7b7f commit 435d4ce

File tree

47 files changed

+664
-395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+664
-395
lines changed

.evergreen.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4274,6 +4274,8 @@ functions:
42744274
source .evergreen/setup-env.sh
42754275
export PUPPETEER_SKIP_DOWNLOAD="true"
42764276
npm run evergreen-release draft
4277+
git add .
4278+
git commit --no-allow-empty -m "chore(release): bump to prepare for mongosh release"
42774279
}
42784280
42794281
release_publish_download_and_list_artifacts:

.evergreen/evergreen.yml.in

+2
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,8 @@ functions:
919919
source .evergreen/setup-env.sh
920920
export PUPPETEER_SKIP_DOWNLOAD="true"
921921
npm run evergreen-release draft
922+
git add .
923+
git commit --no-allow-empty -m "chore(release): bump to prepare for mongosh release"
922924
}
923925

924926
release_publish_download_and_list_artifacts:

.evergreen/install-npm-deps.sh

-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,5 @@ npm run mark-ci-required-optional-dependencies
3131
# along with its types, but npm wouldn't try and compile the addon
3232
(npm ci && test -e node_modules/mongodb-client-encryption) || npm ci --ignore-scripts
3333

34-
npm run evergreen-release bump
35-
3634
echo "npm packages after installation"
3735
npm ls || true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Bump Auxiliary Packages
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
update_generated_files:
10+
name: Bump packages
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
14+
id: app-token
15+
with:
16+
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
17+
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
18+
- uses: actions/checkout@v4
19+
with:
20+
# don't checkout a detatched HEAD
21+
ref: ${{ github.head_ref }}
22+
23+
# this is important so git log can pick up on
24+
# the whole history to generate the list of AUTHORS
25+
fetch-depth: "0"
26+
token: ${{ steps.app-token.outputs.token }}
27+
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: 20.16.0
31+
cache: "npm"
32+
33+
- name: Install [email protected]
34+
run: |
35+
npm install -g [email protected]
36+
37+
- name: Install Dependencies
38+
run: |
39+
npm ci
40+
41+
- name: Bump packages
42+
run: |
43+
npm run bump-auxiliary
44+
git add .
45+
git commit --no-allow-empty -m "chore(release): bump auxiliary packages" || true
46+
47+
- name: Create Pull Request
48+
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5
49+
with:
50+
token: ${{ steps.app-token.outputs.token }}
51+
commit-message: "chore(release): bump auxiliary packages"
52+
branch: ci/bump-auxiliary-packages
53+
title: "chore(release): bump auxiliary packages"
54+
labels: no-title-validation
55+
body: |
56+
- Bumps auxiliary package versions. Merging will trigger a release of these packages.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish Auxiliary Packages
2+
on:
3+
# NOTE: avoid using the manual execution unless is the only way to fix some issue,
4+
# rather retry failed jobs in case of flakes. The manual execution can potentially
5+
# cause the tags to point to a different commit that the one used to publish
6+
# the packages
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
publish:
14+
if: |
15+
github.event_name == 'workflow_dispatch' ||
16+
startsWith(github.event.head_commit.message, 'chore(release): bump auxiliary packages')
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
22+
id: app-token
23+
with:
24+
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
25+
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
26+
27+
- uses: actions/checkout@v4
28+
with:
29+
# don't checkout a detatched HEAD
30+
ref: ${{ github.head_ref }}
31+
32+
# this is important so git log can pick up on
33+
# the whole history to generate the list of AUTHORS
34+
fetch-depth: "0"
35+
token: ${{ steps.app-token.outputs.token }}
36+
37+
- name: "Use Node.js 20"
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 20.16.0
41+
42+
- name: Install [email protected]
43+
run: npm install -g [email protected]
44+
45+
- name: Install Dependencies
46+
run: |
47+
npm run bootstrap-ci
48+
shell: bash
49+
50+
- name: "Publish what is not already in NPM"
51+
env:
52+
NPM_TOKEN: ${{ secrets.DEVTOOLSBOT_NPM_TOKEN }}
53+
run: |
54+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
55+
npm config list
56+
echo "Publishing packages as $(npm whoami)"
57+
npm run publish-auxiliary
58+

lerna.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"packages": [
3-
"configs/*",
4-
"packages/*",
5-
"scripts/docker"
6-
],
7-
"version": "0.0.0-dev.0"
2+
"packages": ["configs/*", "packages/*", "scripts/docker"],
3+
"version": "independent"
84
}

0 commit comments

Comments
 (0)