diff --git a/gulpfile.js b/gulpfile.js index c8234e39c0..d4a62eb117 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,11 +1,25 @@ #!/usr/bin/env node 'use strict'; -var gulp = require('gulp'); +var { task } = require('gulp'); +var fs = require('fs'); var exec = require('child_process').exec; +const util = require('util'); +const promisifyExec = util.promisify(require('child_process').exec); var packageJSON = require('./package.json'); -gulp.task('publishTag', function () { +task('publishTag', function () { exec("git tag v"+ packageJSON.version +"; git push --tags"); }); + +task('updateChangelog', async function update() { + let previous_version = process.argv[4]; + let next_version = packageJSON.version; + await promisifyExec("github-changes -o ethereum -r remix -a --file changes.md --only-pulls --use-commit-body --only-merges --between-tags " + previous_version + "..." + next_version); + let data = fs.readFileSync(__dirname + '/changes.md', 'utf8') + '\n\n' + fs.readFileSync(__dirname + '/CHANGELOG.md', 'utf8') + fs.unlinkSync(__dirname + '/CHANGELOG.md'); + fs.unlinkSync(__dirname + '/changes.md'); + fs.writeFileSync(__dirname + '/CHANGELOG.md', data); + await Promise.resolve(); +}); \ No newline at end of file diff --git a/package.json b/package.json index d5fc9f5ca1..8b9db23de7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "version": "0.1.21", "devDependencies": { - "gulp": "^3.9.1", + "gulp": "^4.0.2", "lerna": "^2.10.2" }, "scripts": { @@ -11,6 +11,7 @@ "publish": "lerna publish", "release": "lerna bootstrap; lerna publish;", "tag": "gulp; gulp publishTag;", + "updateChangelog": "gulp; gulp updateChangelog --prev $previousVersion;", "remove-all-install": "npm run remove-install; npm run remove-install-analyzer; npm run remove-install-astwalker; npm run remove-install-debug; npm run remove-install-lib; npm run remove-install-simulator; npm run remove-install-tests; npm run remove-install-url-resolver; npm run remove-install-remixd; npm run remove-install-solidity;", "remove-install": "rm package-lock.json; rm -rf node_modules", "remove-install-analyzer": "rm remix-analyzer/package-lock.json; rm -rf remix-analyzer/node_modules", diff --git a/release-process.md b/release-process.md index ab7f57edd1..96e7cba8e6 100644 --- a/release-process.md +++ b/release-process.md @@ -2,24 +2,25 @@ This document details steps for publishing packages and tag the code base accordingly: -1) publish (using lerna) all the modules that depends on one of the newly published module: +1) Publish (using lerna) all the modules that depends on one of the newly published module - checkout a new branch from master - npm run publish (that command use lerna) - commit -2) increment the root (repository scoped) package.json +2) Increment the root (repository scoped) package.json - increment root package.json version - commit - merge the branch -3) create a tag (using the package.json version) +3) Create a tag (using the package.json version) - checkout latest origin/master - npm run tag -- github-changes -o ethereum -r remix -a --only-pulls --use-commit-body --only-merges --between-tags previous_version...next_version -- create a new release out of the changelog.md -- in changelog put list of published packages with version +- previousVersion=[previous_version] npm run updateChangelog +- create a new release out of the changes of CHANGELOG.md + +4) Commit new updated CHANGELOG.md