-
Notifications
You must be signed in to change notification settings - Fork 79
chore(ci): add individual publishing of packages MONGOSH-1871 #2289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 25 commits
a2f246b
417e1f4
447e8d1
4c97468
8c9c214
03ba373
ad630dc
28bfce7
45469f9
be919e0
43c551d
71aaa79
ceb13e7
42d19ea
bad9d59
193aa09
a19f408
7ec4049
67c690d
9c4b387
4f43369
c9fd356
285eda6
69c8d6e
68e3e62
ae5b5d4
fc9a406
72f04bd
69baf66
72cde48
4da9db1
2b912d9
e2ceaa5
c736e32
e7d0a8c
fa253de
9c4c358
bb111a5
4d4de5a
755e87a
f0e985b
5513ad7
28b8c37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -917,6 +917,8 @@ functions: | |
{ | ||
export NODE_JS_VERSION=${node_js_version} | ||
source .evergreen/setup-env.sh | ||
git add . | ||
git commit --no-allow-empty -m "chore(release): bump to prepare for mongosh release" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea here is that this will bump both "independent" and mongosh packages before the release draft and push it to main, so our branch is consistent with what we're releasing. I am assuming this should work? Though not sure if the evergreen git setup has ability to push to main like this? |
||
npm run evergreen-release draft | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Bump Auxiliary Packages | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
update_generated_files: | ||
name: Bump packages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Github App Token | ||
uses: mongodb-js/devtools-shared/actions/setup-bot-token@main | ||
id: app-token | ||
with: | ||
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} | ||
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
# don't checkout a detatched HEAD | ||
ref: ${{ github.head_ref }} | ||
gagik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.16.0 | ||
cache: "npm" | ||
|
||
- name: Install [email protected] | ||
run: | | ||
npm install -g [email protected] | ||
|
||
- name: Install Dependencies | ||
run: | | ||
npm -v | ||
gagik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
npm ci | ||
|
||
- name: Bump packages | ||
env: | ||
LAST_BUMP_COMMIT_MESSAGE: "chore(release): bump auxiliary packages" | ||
gagik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
npm run bump-auxiliary | ||
git add . | ||
git commit --no-allow-empty -m "$LAST_BUMP_COMMIT_MESSAGE" || true | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5 | ||
with: | ||
token: ${{ steps.app-token.outputs.token }} | ||
commit-message: "chore(release): bump auxiliary packages" | ||
branch: ci/bump-auxiliary-packages | ||
title: "chore(release): bump auxiliary packages" | ||
labels: no-title-validation | ||
body: | | ||
- Bumps auxiliary package versions. Merging will trigger a release of these packages. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Publish Auxiliary Packages | ||
on: | ||
# NOTE: avoid using the manual execution unless is the only way to fix some issue, | ||
# rather retry failed jobs in case of flakes. The manual execution can potentially | ||
# cause the tags to point to a different commit that the one used to publish | ||
# the packages | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
publish: | ||
if: | | ||
github.event_name == 'workflow_dispatch' || | ||
startsWith(github.event.head_commit.message, 'chore(release): bump auxiliary package versions') | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Create Github App Token | ||
uses: mongodb-js/devtools-shared/actions/setup-bot-token@main | ||
id: app-token | ||
with: | ||
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} | ||
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need this? Is it because publish-auxiliary pushes some tags that we want to configure the git user for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't sure if the git workflow can just push anything at all. To be honest the relationship between the bot token and just an action is a bit unclear to me, might be nice to have a quick explainer on that sometime |
||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
# don't checkout a detatched HEAD | ||
ref: ${{ github.head_ref }} | ||
gagik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: "Use Node.js 14" | ||
gagik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uses: actions/setup-node@v3 | ||
gagik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
node-version: 20.16.0 | ||
|
||
- name: Install [email protected] | ||
run: npm install -g [email protected] | ||
|
||
- name: Install Dependencies | ||
run: | | ||
npm run bootstrap-ci | ||
shell: bash | ||
|
||
- name: "Publish what is not already in NPM" | ||
env: | ||
NPM_TOKEN: ${{ secrets.DEVTOOLSBOT_NPM_TOKEN }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc | ||
gagik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
npm config list | ||
echo "Publishing packages as $(npm whoami)" | ||
git update-index --assume-unchanged .npmrc | ||
npm run publish-auxiliary | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
{ | ||
"packages": [ | ||
"configs/*", | ||
gagik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"packages/*", | ||
"scripts/docker" | ||
], | ||
"version": "0.0.0-dev.0" | ||
"packages": ["configs/*", "packages/*", "scripts/docker"], | ||
"version": "independent" | ||
gagik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
Uh oh!
There was an error while loading. Please reload this page.