Skip to content
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

chore(ci): add individual publishing of packages MONGOSH-1871 #2289

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/bump-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Bump 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 }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be already set for us?

private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
# don't checkout a detatched HEAD
ref: ${{ github.head_ref }}

- 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
npm ci

- name: Bump packages
env:
LAST_BUMP_COMMIT_MESSAGE: "chore(release): bump package versions"
SKIP_BUMP_PACKAGES: "mongodb-compass"
gagik marked this conversation as resolved.
Show resolved Hide resolved
run: |
npm run bump-packages
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 package versions"
branch: ci/bump-packages
title: "chore(release): bump package versions"
labels: no-title-validation
body: |
- Bump package versions
8 changes: 2 additions & 6 deletions lerna.json
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"
Copy link
Contributor Author

@gagik gagik Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addaleax I'm a bit unsure how to go about all this to the point where I can feel much confidence;
What I did here is

  1. remove lerna force publish
  2. use lerna independent mode
  3. add the bump script
    I feel like this should hypothetically do the trick. maybe a couple more changes might be all we need.

I tried i.e. running npm run bump-packages locally and I wonder if it is because of the fact that this PR itself technically changes all of the packages, we end up with a bunch of bumps; some reasonable others not so much.

I assume some of these packages we'd like to ignore right? And also some which we should keep at 0.0.0-dev.0 for our development?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume some of these packages we'd like to ignore right? And also some which we should keep at 0.0.0-dev.0 for our development?

Well, the mongosh and @mongosh/cli-repl packages specifically should still be bumped as part of the process we have now, that can be by using the 0.0.0-dev.0 placeholders but I don't think that's a strict requirement here

}
Loading
Loading