Skip to content

Commit 50f92b8

Browse files
committed
build: minor version bump script
1 parent 6a975cf commit 50f92b8

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.github/workflows/yearly-major-version-bump.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
src/index.html
3838
body: |
3939
Bump patch version to ${{ env.PHOENIX_VERSION }}
40-
- Auto-generated by `patch-version-bump.yml` action
40+
- Auto-generated by `yearly-major-version-bump.yml` action
4141
- name: Check outputs
4242
if: ${{ steps.cpr.outputs.pull-request-number }}
4343
run: |

gulpfile.js/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,16 @@ function _patchBumpConfigFile(fileName) {
196196
fs.writeFileSync(fileName, JSON.stringify(config, null, 4));
197197
}
198198

199+
function _minorBumpConfigFile(fileName) {
200+
let config = JSON.parse(fs.readFileSync(fileName, 'utf8'));
201+
let version = config.apiVersion .split("."); // ["3","0","0"]
202+
version[1] = "" + (parseInt(version[1]) + 1); // ["3","1","0"]
203+
config.apiVersion = version.join("."); // 3.1.0
204+
config.version = `${config.apiVersion}-0`; // 3.1.0-0 . The final build number is always "-0" as the build number
205+
// is generated by release scripts only and never checked in source.
206+
fs.writeFileSync(fileName, JSON.stringify(config, null, 4));
207+
}
208+
199209
function _majorVersionBumpConfigFile(fileName) {
200210
let config = JSON.parse(fs.readFileSync(fileName, 'utf8'));
201211
let version = config.apiVersion .split("."); // ["3","0","0"]
@@ -242,6 +252,17 @@ function patchVersionBump() {
242252
});
243253
}
244254

255+
function minorVersionBump() {
256+
// adding anything here should be added to patch-version-bump.yml and yearly-major-version-bump.yml
257+
return new Promise((resolve)=> {
258+
_minorBumpConfigFile('./package.json');
259+
_minorBumpConfigFile('./src-node/package.json');
260+
_minorBumpConfigFile('./src/config.json');
261+
_patchIndexHTML();
262+
resolve();
263+
});
264+
}
265+
245266
function majorVersionBump() {
246267
// adding anything here should be added to patch-version-bump.yml and yearly-major-version-bump.yml
247268
return new Promise((resolve)=> {
@@ -696,4 +717,5 @@ exports.createJSDocs = series(cleanDocs, createJSDocs, generateDocIndex);
696717
exports.translateStrings = series(translateStrings);
697718
exports.default = series(exports.build);
698719
exports.patchVersionBump = series(patchVersionBump);
720+
exports.minorVersionBump = series(minorVersionBump);
699721
exports.majorVersionBump = series(majorVersionBump);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"release:prod": "gulp releaseProd",
7070
"_releaseWebCache": "gulp releaseWebCache",
7171
"_patchVersionBump": "gulp patchVersionBump",
72+
"_minorVersionBump": "gulp minorVersionBump",
7273
"_majorVersionBump": "gulp majorVersionBump",
7374
"serve": "http-server . -p 8000 -c-1",
7475
"_serveWithWebCacheHelp": "echo !!!Make sure to npm run release:dev/stageing/prod before testing the cache!!!",

0 commit comments

Comments
 (0)