File tree Expand file tree Collapse file tree 4 files changed +63
-14
lines changed Expand file tree Collapse file tree 4 files changed +63
-14
lines changed Original file line number Diff line number Diff line change 10
10
check-script :
11
11
uses : dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@main
12
12
with :
13
- configuration_file_path : ' .config/snap-flow.json'
13
+ configuration_file_path : ' .config/snap-flow.json'
14
+
15
+ create-pull-request :
16
+ if : github.ref == 'refs/heads/main'
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - name : Check out
20
+ uses : actions/checkout@v2
21
+ - name : Install NodeJS
22
+ uses : actions/setup-node@v4
23
+ with :
24
+ node-version : ' 18.x'
25
+ - name : Install dependencies
26
+ run : npm ci
27
+ - name : Update version.json
28
+ run : npx gulp incrementVersionJson
29
+ - name : Create version.json update PR
30
+ uses : peter-evans/create-pull-request@v4
31
+ with :
32
+ token : ${{ secrets.GITHUB_TOKEN }}
33
+ commit-message : Update main version
34
+ title : ' Update main version'
35
+ branch : merge/update-main-version
Original file line number Diff line number Diff line change @@ -9,3 +9,4 @@ require('./tasks/backcompatTasks');
9
9
require ( './tasks/localizationTasks' ) ;
10
10
require ( './tasks/createTagsTasks' ) ;
11
11
require ( './tasks/debuggerTasks' ) ;
12
+ require ( './tasks/snapTasks' ) ;
Original file line number Diff line number Diff line change
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ import * as gulp from 'gulp' ;
7
+ import * as fs from 'fs' ;
8
+ import * as path from 'path' ;
9
+
10
+ gulp . task ( 'incrementVersionJson' , async ( ) : Promise < void > => {
11
+ const versionFilePath = path . join ( path . resolve ( __dirname , '..' ) , 'version.json' ) ;
12
+ const file = fs . readFileSync ( versionFilePath , 'utf8' ) ;
13
+ const versionJson = JSON . parse ( file ) ;
14
+
15
+ const version = versionJson . version as string ;
16
+ const split = version . split ( '.' ) ;
17
+ const newVersion = `${ split [ 0 ] } .${ parseInt ( split [ 1 ] ) + 1 } ` ;
18
+
19
+ console . log ( `Updating ${ version } to ${ newVersion } ` ) ;
20
+
21
+ versionJson . version = newVersion ;
22
+ const newJson = JSON . stringify ( versionJson , null , 4 ) ;
23
+ console . log ( `New json: ${ newJson } ` ) ;
24
+
25
+ fs . writeFileSync ( versionFilePath , newJson ) ;
26
+ } ) ;
Original file line number Diff line number Diff line change 1
1
{
2
- "$schema" : " https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json" ,
3
- "version" : " 2.40" ,
4
- "publicReleaseRefSpec" : [
5
- " ^refs/heads/release$" ,
6
- " ^refs/heads/prerelease$" ,
7
- " ^refs/heads/main$" ,
8
- " ^refs/heads/patch/.*$"
9
- ],
10
- "cloudBuild" : {
11
- "buildNumber" : {
12
- "enabled" : false
13
- }
14
- }
2
+ "$schema" : " https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json" ,
3
+ "version" : " 2.40" ,
4
+ "publicReleaseRefSpec" : [
5
+ " ^refs/heads/release$" ,
6
+ " ^refs/heads/prerelease$" ,
7
+ " ^refs/heads/main$" ,
8
+ " ^refs/heads/patch/.*$"
9
+ ],
10
+ "cloudBuild" : {
11
+ "buildNumber" : {
12
+ "enabled" : false
13
+ }
14
+ }
15
15
}
You can’t perform that action at this time.
0 commit comments