-
Notifications
You must be signed in to change notification settings - Fork 676
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update branch snap to also incrememnt version.json
- Loading branch information
David Barbet
authored and
David Barbet
committed
Jul 15, 2024
1 parent
051cd12
commit 298a185
Showing
4 changed files
with
52 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as gulp from 'gulp'; | ||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
|
||
gulp.task('incrementVersionJson', async (): Promise<void> => { | ||
let versionFilePath = path.join(path.resolve(__dirname, '..'), 'version.json'); | ||
let file = fs.readFileSync(versionFilePath, 'utf8'); | ||
let versionJson = JSON.parse(file); | ||
|
||
let version = versionJson.version as string; | ||
let split = version.split('.'); | ||
let newVersion = `${split[0]}.${parseInt(split[1]) + 1}`; | ||
|
||
console.log(`Updating ${version} to ${newVersion}`); | ||
|
||
versionJson.version = newVersion; | ||
let newJson = JSON.stringify(versionJson, null, 4); | ||
console.log(`New json: ${newJson}`); | ||
|
||
fs.writeFileSync(versionFilePath, newJson); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", | ||
"version": "2.39", | ||
"publicReleaseRefSpec": [ | ||
"^refs/heads/release$", | ||
"^refs/heads/prerelease$", | ||
"^refs/heads/main$", | ||
"^refs/heads/patch/.*$" | ||
], | ||
"cloudBuild": { | ||
"buildNumber": { | ||
"enabled": false | ||
} | ||
} | ||
} | ||
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", | ||
"version": "2.39", | ||
"publicReleaseRefSpec": [ | ||
"^refs/heads/release$", | ||
"^refs/heads/prerelease$", | ||
"^refs/heads/main$", | ||
"^refs/heads/patch/.*$" | ||
], | ||
"cloudBuild": { | ||
"buildNumber": { | ||
"enabled": false | ||
} | ||
} | ||
} |