-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e8f747
commit db524da
Showing
5 changed files
with
96 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,10 @@ | |
|
||
*.phar | ||
*.lock | ||
package-lock.json | ||
|
||
/node_modules/ | ||
/vendor/ | ||
_build/ | ||
/html | ||
|
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,23 @@ | ||
{ | ||
"name": "compare-system-versions", | ||
"version": "0.0.0", | ||
"description": "Compare System Versions", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"release-task": "^1.0.0" | ||
}, | ||
"scripts": { | ||
"release": "node ./scripts/release.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/adrianorsouza/compare-system-versions.git" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/adrianorsouza/compare-system-versions/issues" | ||
}, | ||
"homepage": "https://github.com/adrianorsouza/compare-system-versions#readme" | ||
} |
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,61 @@ | ||
/** ======================================================================== | ||
* Project : compare-system-versions | ||
* Description : release | ||
* Author : Adriano Rosa <https://adrianorosa.com> | ||
* Date : 2020-07-23 17:16 | ||
* ======================================================================== | ||
* Copyright 2020 Adriano Rosa <https://adrianorosa.com> | ||
* ======================================================================== */ | ||
|
||
const util = require('util'); | ||
const exec = util.promisify(require('child_process').exec); | ||
const releaseTask = require('release-task'); | ||
const { writeLog } = require('release-task/src/helpers'); | ||
|
||
// create a new instance of releaseTask | ||
const tasks = new releaseTask({ | ||
bumpFiles: ['composer.json', 'package.json'], | ||
commitFiles: ['composer.json', 'package.json', 'CHANGELOG.md'], | ||
config: { | ||
indentSize: 2 | ||
} | ||
}); | ||
|
||
|
||
const push = async () => { | ||
writeLog('TASK push'); | ||
const {stdout, stderr} = exec('git push -u origin master --tags 2>&1'); | ||
if (stderr) throw new Error(`TASK push result an error ${stderr}`); | ||
return `TASK push has been completed.\n\n${stdout}`; | ||
}; | ||
|
||
|
||
// async function compilePHAR(version, options) { | ||
const compilePHAR = async (version, options) => { | ||
writeLog('TASK compilePHAR'); | ||
const { stdout, stderr } = await exec('box compile'); | ||
|
||
if (stderr) { | ||
throw new Error(`An error occurred ${stderr}`); | ||
} | ||
|
||
if (stdout) { | ||
return `Compile phar using box DONE!\n\n${stdout}` | ||
} | ||
} | ||
|
||
|
||
// Create a custom task named push | ||
tasks.addTask('push', push, { | ||
checked: false, | ||
value: 'push', | ||
name: 'Push new releases', | ||
}); | ||
|
||
tasks.addTask('compilePHAR', compilePHAR, { | ||
checked: true, | ||
value: 'compilePHAR', | ||
name: 'Compile phar using box', | ||
}); | ||
|
||
tasks.init(); |