@@ -140,37 +140,6 @@ resume_config() {
140
140
mv _config.yml.bak _config.yml
141
141
}
142
142
143
- # auto-generate a new version number to the file 'package.json'
144
- standard_version () {
145
- if $opt_pre ; then
146
- standard-version --prerelease rc
147
- else
148
- standard-version
149
- fi
150
- }
151
-
152
- # Prevent changelogs generated on master branch from having duplicate content
153
- # (the another bug of `standard-version`)
154
- standard_version_plus () {
155
- temp_branch=" prod-mirror"
156
- temp_dir=" $( mktemp -d) "
157
-
158
- git checkout -b " $temp_branch " " $PROD_BRANCH "
159
- git merge --no-ff --no-edit " $STAGING_BRANCH "
160
-
161
- standard_version
162
-
163
- cp package.json CHANGELOG.md " $temp_dir "
164
-
165
- git checkout " $STAGING_BRANCH "
166
- git reset --hard HEAD # undo the changes from $temp_branch
167
- mv " $temp_dir " /* . # rewrite the changelog
168
-
169
- # clean up the temp stuff
170
- rm -rf " $temp_dir "
171
- git branch -D " $temp_branch "
172
- }
173
-
174
143
# build a gem package
175
144
build_gem () {
176
145
echo -e " Build the gem package for v$_version \n"
@@ -184,13 +153,13 @@ build_gem() {
184
153
release () {
185
154
_version=" $1 " # X.Y.Z
186
155
187
- git checkout " $PROD_BRANCH "
188
- git merge --no-ff --no-edit " $working_branch "
189
-
190
- # Create a new tag on production branch
156
+ # Create a new tag on working branch
191
157
echo -e " Create tag v$_version \n"
192
158
git tag " v$_version "
193
159
160
+ git checkout " $PROD_BRANCH "
161
+ git merge --no-ff --no-edit " $working_branch "
162
+
194
163
# merge from patch branch to the staging branch
195
164
# NOTE: This may break due to merge conflicts, so it may need to be resolved manually.
196
165
if [[ $working_branch == hotfix/* ]]; then
@@ -203,15 +172,13 @@ release() {
203
172
main () {
204
173
check
205
174
206
- if [[ " $working_branch " == " $STAGING_BRANCH " ]]; then
207
- standard_version_plus
175
+ # auto-generate a new version number to the file 'package.json'
176
+ if $opt_pre ; then
177
+ standard-version --prerelease rc
208
178
else
209
- standard_version
179
+ standard-version
210
180
fi
211
181
212
- # Change heading of Patch version to level 2 (a bug from `standard-version`)
213
- sed -i " s/^### \[/## \[/g" CHANGELOG.md
214
-
215
182
_version=" $( grep ' "version":' package.json | sed ' s/.*: "//;s/".*//' ) "
216
183
217
184
echo -e " Bump version number to $_version \n"
0 commit comments