Change convention for unreleased changelog entries
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 3.3.0 (unreleased)
|
## Unreleased
|
||||||
|
|
||||||
* `Address`: added `functionStaticCall` and `functionDelegateCall`, similar to the existing `functionCall`. ([#2333](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2333))
|
* `Address`: added `functionStaticCall` and `functionDelegateCall`, similar to the existing `functionCall`. ([#2333](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2333))
|
||||||
* `TimelockController`: added a contract to augment access control schemes with a delay. ([#2364](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2364))
|
* `TimelockController`: added a contract to augment access control schemes with a delay. ([#2364](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2364))
|
||||||
|
|||||||
@ -6,28 +6,25 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const cp = require('child_process');
|
const cp = require('child_process');
|
||||||
|
|
||||||
const pkg = require('../../package.json');
|
|
||||||
const suffix = process.env.PRERELEASE_SUFFIX || 'rc';
|
|
||||||
if (pkg.version.indexOf('-' + suffix) !== -1) {
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
const version = pkg.version.replace(/-.*/, ''); // Remove the rc suffix
|
|
||||||
|
|
||||||
const changelog = fs.readFileSync('CHANGELOG.md', 'utf8');
|
const changelog = fs.readFileSync('CHANGELOG.md', 'utf8');
|
||||||
|
|
||||||
// The changelog entry to be updated looks like this:
|
// The changelog entry to be updated looks like this:
|
||||||
// ## 2.5.3 (unreleased)
|
// ## Unreleased
|
||||||
// We need to add the date in a YYYY-MM-DD format, so that it looks like this:
|
// We need to add the version and release date in a YYYY-MM-DD format, so that it looks like this:
|
||||||
// ## 2.5.3 (2019-04-25)
|
// ## 2.5.3 (2019-04-25)
|
||||||
|
|
||||||
if (changelog.indexOf(`## ${version} (unreleased)`) === -1) {
|
const unreleased = /^## Unreleased$/im;
|
||||||
throw Error(`Found no changelog entry for version ${version}`);
|
|
||||||
|
if (!unreleased.test(changelog)) {
|
||||||
|
console.error('Missing changelog entry');
|
||||||
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { version } = require('../../package.json');
|
||||||
|
|
||||||
fs.writeFileSync('CHANGELOG.md', changelog.replace(
|
fs.writeFileSync('CHANGELOG.md', changelog.replace(
|
||||||
`## ${version} (unreleased)`,
|
unreleased,
|
||||||
`## ${version} (${new Date().toISOString().split('T')[0]})`),
|
`## ${version} (${new Date().toISOString().split('T')[0]})`)
|
||||||
);
|
);
|
||||||
|
|
||||||
cp.execSync('git add CHANGELOG.md', { stdio: 'inherit' });
|
cp.execSync('git add CHANGELOG.md', { stdio: 'inherit' });
|
||||||
|
|||||||
Reference in New Issue
Block a user