From 7cce61ed20c464f6d88ef54b03d0e202357fe425 Mon Sep 17 00:00:00 2001 From: dmvict Date: Mon, 19 Jun 2023 15:04:01 +0300 Subject: [PATCH 1/4] Add step `tag.major`, allow to use action with the major tag --- step/ActionWrite.s | 52 --------------------------------------------- step/TagMajorStep.s | 19 +++++++++++++++++ will.yml | 5 +++++ 3 files changed, 24 insertions(+), 52 deletions(-) delete mode 100644 step/ActionWrite.s create mode 100644 step/TagMajorStep.s diff --git a/step/ActionWrite.s b/step/ActionWrite.s deleted file mode 100644 index 2f8d3001..00000000 --- a/step/ActionWrite.s +++ /dev/null @@ -1,52 +0,0 @@ - -const _ = require( 'wTools' ); -_.include( 'wFiles' ); - -function actionWrite( o ) -{ - o = _.routine.optionsWithUndefined( actionWrite, o || Object.create( null ) ); - - const appArgs = _.process.input(); - _.process.inputReadTo - ({ - dst : o, - propertiesMap : appArgs.map, - namesMap : _.map.keys( actionWrite.defaults ), - }); - - /* */ - - const willfilePath = _.path.join( __dirname, '../will.yml' ); - const willfile = _.fileProvider.fileReadUnknown( willfilePath ); - willfile.about.version = o.version; - - if( o.logger >= 3 ) - console.log( `Updating willfile. Setup version "${ o.version }".` ); - - if( !o.dry ) - _.fileProvider.fileWrite({ filePath : willfilePath, data : willfile, encoding : 'yaml' }); - - /* */ - - const actionPath = _.path.join( __dirname, '../action.yml' ); - const action = _.fileProvider.fileReadUnknown( actionPath ); - action.runs.steps[ 0 ].uses = `Wandalen/wretry.action@v${ o.version }_js_action`; - - if( o.logger >= 3 ) - console.log( `Updating action. Setup used action version to "Wandalen/wretry.action@v${ o.version }_js_action".` ); - - if( !o.dry ) - _.fileProvider.fileWrite({ filePath : actionPath, data : action, encoding : 'yaml' }); -} - -let defaults = actionWrite.defaults = Object.create( null ); -defaults.version = null; -defaults.logger = 2; -defaults.dry = 0; - -// - -const step = actionWrite; -module.exports = step; -if( !module.parent ) -step(); diff --git a/step/TagMajorStep.s b/step/TagMajorStep.s new file mode 100644 index 00000000..fd753a49 --- /dev/null +++ b/step/TagMajorStep.s @@ -0,0 +1,19 @@ + +function majorTagSet( frame ) +{ + const run = frame.run; + const module = run.module; + + const splits = module.about.version.split( '.' ); + const version = splits[ 0 ]; + + return module.gitTag + ({ + tag : `v${ version }`, + description : '', + dry : 0, + light : 1, + }); +} + +module.exports = majorTagSet; diff --git a/will.yml b/will.yml index e52f8b76..aa542bd5 100644 --- a/will.yml +++ b/will.yml @@ -360,6 +360,9 @@ step: tag.js_action: inherit: git.tag tag: 'v{about::version}_js_action' + tag.major: + inherit: js.run + js: '{path::step}/TagMajorStep.s' push: inherit: git.push dirPath: . @@ -392,6 +395,7 @@ build: - add - commit - tag + - tag.major - push - release action.release: @@ -418,6 +422,7 @@ build: - add - commit - tag + - tag.major - push - release doc.export: From fcb140c066306610a9f98930b0d1359b8f2a8cfd Mon Sep 17 00:00:00 2001 From: dmvict Date: Mon, 19 Jun 2023 15:32:41 +0300 Subject: [PATCH 2/4] Extend scenarios, add step to switch on master branch --- will.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/will.yml b/will.yml index e52f8b76..ce7b7c34 100644 --- a/will.yml +++ b/will.yml @@ -376,6 +376,7 @@ build: default: 1 bump: patch steps: + - switch.master - sync - switch.js_action - clean.npm @@ -402,6 +403,7 @@ build: - minor - patch steps: + - switch.master - sync - switch.js_action - clean.npm From fcabebb3866eccf2537b0eeb7df858d9514d5817 Mon Sep 17 00:00:00 2001 From: dmvict Date: Mon, 19 Jun 2023 15:52:44 +0300 Subject: [PATCH 3/4] Extend reflector `clean.modules`, exclude module `uuid` from the cleanup --- will.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/will.yml b/will.yml index ce7b7c34..56997df4 100644 --- a/will.yml +++ b/will.yml @@ -186,6 +186,7 @@ reflector: - ! /retry/ - ! /signal-exit/ - ! /tunnel/ + - ! /uuid/ - ! /yaml-ast-parser/ - ! /Joined.s/ step: From 11f5adeea4b23aa1e7021c6badcc645da2b604f7 Mon Sep 17 00:00:00 2001 From: dmvict Date: Tue, 20 Jun 2023 10:46:28 +0300 Subject: [PATCH 4/4] Update willfile, add synchronization step on branch `js_action` --- will.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/will.yml b/will.yml index 57da34f8..a8e97aa2 100644 --- a/will.yml +++ b/will.yml @@ -383,6 +383,7 @@ build: - switch.master - sync - switch.js_action + - sync - clean.npm - 'build::build.compiled' - bump.*=1 @@ -411,6 +412,7 @@ build: - switch.master - sync - switch.js_action + - sync - clean.npm - 'build::build.compiled' - bump.*=1