File tree Expand file tree Collapse file tree 4 files changed +49
-16
lines changed Expand file tree Collapse file tree 4 files changed +49
-16
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,21 @@ jobs:
13
13
configuration_file_path : ' .config/snap-flow.json'
14
14
15
15
create-pull-request :
16
- if : github.ref == 'refs/heads/testing_action'
16
+ if : github.ref == 'refs/heads/main'
17
+ runs-on : ubuntu-latest
17
18
steps :
18
19
- name : Check out
19
20
uses : actions/checkout@v2
21
+ - name : Install NodeJS
22
+ uses : actions/setup-node@v4
23
+ with :
24
+ node-version : ' 18.x'
25
+ - name : Update version.json
26
+ run : npx gulp incrementVersionJson
20
27
- name : Create version.json update PR
21
28
uses : peter-evans/create-pull-request@v4
22
29
with :
23
30
token : ${{ secrets.GITHUB_TOKEN }}
24
31
commit-message : Update main version
25
32
title : ' Update main version'
26
33
branch : merge/update-main-version
27
- # awk '/"version":/{split($2,a,/[.]/);$1=" \"version\":";$2=a[1]"."a[2]+1"$3"};1' version.json
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
+ let versionFilePath = path . join ( path . resolve ( __dirname , '..' ) , 'version.json' ) ;
12
+ let file = fs . readFileSync ( versionFilePath , 'utf8' ) ;
13
+ let versionJson = JSON . parse ( file ) ;
14
+
15
+ let version = versionJson . version as string ;
16
+ let split = version . split ( '.' ) ;
17
+ let newVersion = `${ split [ 0 ] } .${ parseInt ( split [ 1 ] ) + 1 } ` ;
18
+
19
+ console . log ( `Updating ${ version } to ${ newVersion } ` ) ;
20
+
21
+ versionJson . version = newVersion ;
22
+ let 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.39 " ,
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
- }
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
+ }
You can’t perform that action at this time.
0 commit comments