diff --git a/.github/workflows/merge-release-tag.yml b/.github/workflows/merge-release-tag.yml new file mode 100644 index 0000000000..8f9583f589 --- /dev/null +++ b/.github/workflows/merge-release-tag.yml @@ -0,0 +1,33 @@ +name: Merge Release Tag + +on: + push: + tags: + - 'mongosh@[0-9]+.[0-9]+.[0-9]+' + - 'mongosh@[0-9]+.[0-9]+.[0-9]-rc.[0-9]+' + workflow_dispatch: + +permissions: + contents: none # We use the github app to checkout and push changes + +jobs: + merge-release-tag: + runs-on: ubuntu-latest + + steps: + - 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: + ref: main + fetch-depth: "0" + token: ${{ steps.app-token.outputs.token }} + + - name: Merge release tag into main + run: | + git merge ${{ github.ref }} -m "chore(release): merge changes from ${{ github.ref_name }}" + git push origin main diff --git a/packages/build/README.md b/packages/build/README.md index 6df95c36ee..938d0da1d7 100644 --- a/packages/build/README.md +++ b/packages/build/README.md @@ -39,7 +39,7 @@ Execute the following steps to publish a new release: ``` Follow the instructions and verify the inferred release version is correct. 7. Wait for Evergreen to finish the publication stage. -8. The previous step will have pushed tags for the npm publishes. Check out the tag for `mongosh@` (not `v`), create a branch for it, push that branch and open a PR with it. Then immediately merge that branch **using the `git merge` CLI command into main** and push to main. **NEVER** use the Github PR merge functionality, since that would squash the commit and give it a new commit hash that is different from the one in the tag. +8. Ensure that the version bump was automatically merged into main and that it is synced up with the `mongosh@x.x.x` tag. 9. Close the Jira ticket for the release, post an update in the `#mongosh` Slack channel and ping the docs team. ### Branches and Tags