1
- name : Draft release
1
+ name : Prepare mongosh release
2
2
3
3
on :
4
4
workflow_dispatch :
5
5
inputs :
6
+ jiraTicket :
7
+ description : ' Jira ticket for the release, e.g. MONGOSH-1234'
8
+ required : true
9
+
6
10
versionBump :
7
11
description : ' Version bump'
8
12
type : choice
22
26
prepare-release :
23
27
runs-on : ubuntu-latest
24
28
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
+
25
36
- name : Checkout
26
37
uses : actions/checkout@v4
27
38
with :
36
47
37
48
- name : Determine Next Version
38
49
shell : bash
39
- env :
40
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41
50
run : |
42
51
set -e
43
52
51
60
else
52
61
NEXT_VERSION=${{ github.event.inputs.exactVersion }}
53
62
fi
63
+
64
+ # Remove the 'v' prefix from NEXT_VERSION if it exists
65
+ NEXT_VERSION="${NEXT_VERSION#v}"
54
66
55
67
# Validates the version before using it
56
68
npx semver v"${NEXT_VERSION}"
@@ -74,21 +86,26 @@ jobs:
74
86
fi
75
87
76
88
- 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 }}"
77
92
run : |
78
93
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
87
95
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
94
100
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