1- name : Draft release
1+ name : Prepare mongosh release
22
33on :
44 workflow_dispatch :
55 inputs :
6+ jiraTicket :
7+ description : ' Jira ticket for the release, e.g. MONGOSH-1234'
8+ required : true
9+
610 versionBump :
711 description : ' Version bump'
812 type : choice
2226 prepare-release :
2327 runs-on : ubuntu-latest
2428 steps :
29+ - name : Create Github App Token
30+ uses : mongodb-js/devtools-shared/actions/setup-bot-token@main
31+ id : app-token
32+ with :
33+ app-id : ${{ vars.DEVTOOLS_BOT_APP_ID }}
34+ private-key : ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
35+
2536 - name : Checkout
2637 uses : actions/checkout@v4
2738 with :
3647
3748 - name : Determine Next Version
3849 shell : bash
39- env :
40- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4150 run : |
4251 set -e
4352
5160 else
5261 NEXT_VERSION=${{ github.event.inputs.exactVersion }}
5362 fi
63+
64+ # Remove the 'v' prefix from NEXT_VERSION if it exists
65+ NEXT_VERSION="${NEXT_VERSION#v}"
5466
5567 # Validates the version before using it
5668 npx semver v"${NEXT_VERSION}"
@@ -74,21 +86,26 @@ jobs:
7486 fi
7587
7688 - name : Bump mongosh and package versions
89+ shell : bash
90+ env :
91+ LAST_BUMP_COMMIT_MESSAGE : " chore(release): prepare for mongosh v${NEXT_VERSION} ${{ github.event.inputs.jiraTicket }}"
7792 run : |
7893 set -e
79- echo Bumping mongosh versions to ${RELEASE_TAG} and packages
80-
81- MONGOSH_RELEASE_VERSION=${RELEASE_TAG} npm run bump
82-
83- - name : Create Draft Release
84- run : |
85- set -e
86- echo Creating draft release for: "${RELEASE_TAG}"
94+ echo Bumping mongosh versions to ${NEXT_VERSION} and packages
8795
88- git tag ${RELEASE_TAG}
89- git push origin ${RELEASE_TAG}
90-
91- shell : bash
92- env :
93- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
96+ MONGOSH_RELEASE_VERSION=${NEXT_VERSION} npm run bump
97+
98+ git add .
99+ git commit --no-allow-empty -m "$LAST_BUMP_COMMIT_MESSAGE" || true
94100
101+ - name : Create Pull Request
102+ uses : peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5
103+ with :
104+ token : ${{ steps.app-token.outputs.token }}
105+ commit-message : " chore(release): prepare for mongosh v${NEXT_VERSION} ${{ github.event.inputs.jiraTicket }}"
106+ branch : release/${NEXT_VERSION}
107+ title : " chore(release): prepare for mongosh v${NEXT_VERSION} ${{ github.event.inputs.jiraTicket }}"
108+ body : |
109+ - [${{ github.event.inputs.jiraTicket }}](https://jira.mongodb.org/browse/${{ github.event.inputs.jiraTicket }})
110+ - This PR is for the release of mongosh v${NEXT_VERSION}.
111+ - **Do not merge manually, use the Release mongosh action instead.**
0 commit comments