diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index f8376151c..2d3745e80 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 1.0.2 (unreleased) +## Unreleased - Fix false positive variable initialization check in Solidity 0.7.1. ([#171](https://github.com/OpenZeppelin/openzeppelin-upgrades/pull/171)) diff --git a/packages/core/package.json b/packages/core/package.json index 9774ab578..9530c4719 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -16,7 +16,8 @@ "prepare": "tsc -b && yarn prepare:contracts", "prepare:contracts": "buidler compile", "test": "tsc -b && buidler compile --force && ava", - "test:watch": "buidler compile --force && fgbg 'ava --watch' 'tsc -b --watch'" + "test:watch": "buidler compile --force && fgbg 'ava --watch' 'tsc -b --watch'", + "version": "node ../../scripts/bump-changelog.js" }, "devDependencies": { "@nomiclabs/buidler": "^1.3.6", diff --git a/packages/plugin-buidler/package.json b/packages/plugin-buidler/package.json index 5c51bd663..59d1277fb 100644 --- a/packages/plugin-buidler/package.json +++ b/packages/plugin-buidler/package.json @@ -12,7 +12,8 @@ "prepublish": "rimraf dist *.tsbuildinfo", "prepare": "tsc -b", "test": "tsc -b && ava", - "test:watch": "fgbg 'ava --watch' 'tsc -b --watch'" + "test:watch": "fgbg 'ava --watch' 'tsc -b --watch'", + "version": "node ../../scripts/bump-changelog.js" }, "devDependencies": { "@nomiclabs/buidler": "^1.3.7", diff --git a/packages/plugin-truffle/package.json b/packages/plugin-truffle/package.json index fc1500312..c39074d05 100644 --- a/packages/plugin-truffle/package.json +++ b/packages/plugin-truffle/package.json @@ -11,7 +11,8 @@ "scripts": { "prepublish": "rimraf dist *.tsbuildinfo", "prepare": "tsc -b", - "test": "tsc -b && bash test.sh" + "test": "tsc -b && bash test.sh", + "version": "node ../../scripts/bump-changelog.js" }, "devDependencies": { "bn.js": "^5.1.2", diff --git a/scripts/bump-changelog.js b/scripts/bump-changelog.js new file mode 100644 index 000000000..fb756d7a2 --- /dev/null +++ b/scripts/bump-changelog.js @@ -0,0 +1,19 @@ +#!/usr/bin/env node + +const { version } = require(process.cwd() + '/package.json'); +const [date] = new Date().toISOString().split('T'); + +const fs = require('fs'); +const changelog = fs.readFileSync('CHANGELOG.md', 'utf8'); + +const unreleased = /^## Unreleased$/im; + +if (!unreleased.test(changelog)) { + console.error('Missing changelog entry'); + process.exit(1); +} + +fs.writeFileSync('CHANGELOG.md', changelog.replace(unreleased, `## ${version} (${date})`)); + +const proc = require('child_process'); +proc.execSync('git add CHANGELOG.md', { stdio: 'inherit' });