changelog auto update

pull/7/head
aniket-engg 5 years ago
parent 4507a805f1
commit 74754b1adc
  1. 18
      gulpfile.js
  2. 3
      package.json
  3. 13
      release-process.md

@ -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();
});

@ -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",

@ -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

Loading…
Cancel
Save