Skip to content

Commit

Permalink
Merge pull request #102 from dmvict/restore_step
Browse files Browse the repository at this point in the history
READY: Add missed action file, update code to run from utility
  • Loading branch information
Wandalen authored Jun 21, 2023
2 parents 6baa584 + bc8ecc2 commit fcc3d8e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
34 changes: 34 additions & 0 deletions step/ActionWrite.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

function actionWrite( frame )
{
const run = frame.run;
const module = run.module;
const will = module.will;
const fileProvider = will.fileProvider;
const logger = will.transaction.logger;
const opener = module.toOpener();

/* */

logger.log( `Updating willfile. Setup version "${ module.about.version }".` );

const commonPath = fileProvider.path.common( opener.openedModule.willfilesPath );
will.willfilePropertySet
({
commonPath,
request: '',
selectorsMap: { 'about/version' : module.about.version },
});

/* */

const actionPath = fileProvider.path.join( module.dirPath, 'action.yml' );
const action = fileProvider.fileReadUnknown( actionPath );
action.runs.steps[ 0 ].uses = `Wandalen/wretry.action@v${ module.about.version }_js_action`;

logger.log( `Updating action. Setup used action version to "Wandalen/wretry.action@v${ module.about.version }_js_action".` );

fileProvider.fileWrite({ filePath : actionPath, data : action, encoding : 'yaml' });
}

module.exports = actionWrite;
8 changes: 2 additions & 6 deletions will.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,6 @@ step:
- proto
npm.install:
shell: npm install --production
npm.install.dev:
shell: npm install wFiles
clean.out:
inherit: files.delete
filePath: '{path::out.*=1}/source'
Expand Down Expand Up @@ -368,8 +366,8 @@ step:
inherit: git.push
dirPath: .
action.write:
currentPath: 'path::in'
shell: 'node {path::step}/ActionWrite.s version:{about::version} logger:3'
inherit: js.run
js: '{path::step}/ActionWrite.s'
release:
inherit: repo.release
tag: 'v{about::version}'
Expand All @@ -393,7 +391,6 @@ build:
- tag.js_action
- push
- switch.master
- npm.install.dev
- action.write
- add
- commit
Expand Down Expand Up @@ -422,7 +419,6 @@ build:
- tag.js_action
- push
- switch.master
- npm.install.dev
- action.write
- add
- commit
Expand Down

0 comments on commit fcc3d8e

Please sign in to comment.