Browse Source

Merge branch 'master' into solc-0.7

Francisco Giordano 4 years ago
parent
commit
58892471a3
4 changed files with 14 additions and 10 deletions
  1. 1 1
      .solhint.json
  2. 1 1
      CHANGELOG.md
  3. 1 1
      scripts/release/release.sh
  4. 11 7
      scripts/release/update-changelog-release-date.js

+ 1 - 1
.solhint.json

@@ -4,7 +4,7 @@
     "func-order": "off",
     "mark-callable-contracts": "off",
     "no-empty-blocks": "off",
-    "compiler-version": ["error", "^0.7.0"],
+    "compiler-version": "off",
     "private-vars-leading-underscore": "error",
     "reason-string": "off",
     "func-visibility": ["error", { "ignoreConstructors": true }]

+ 1 - 1
CHANGELOG.md

@@ -4,7 +4,7 @@
 
  * `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))
- * `EnumerableSet`: added `BytesSet`, for sets of `bytes32`. ([#2395](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2395))
+ * `EnumerableSet`: added `Bytes32Set`, for sets of `bytes32`. ([#2395](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2395))
 
 ## 3.2.2-solc-0.7 (2020-10-28)
  * Resolve warnings introduced by Solidity 0.7.4. ([#2396](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2396))

+ 1 - 1
scripts/release/release.sh

@@ -17,7 +17,7 @@ current_version() {
 
 current_release_branch() {
   v="$(current_version)"
-  echo "release-${v%%-"$PRERELEASE_SUFFIX".*}"
+  echo "release-${v%.*-"$PRERELEASE_SUFFIX".*}"
 }
 
 assert_current_branch() {

+ 11 - 7
scripts/release/update-changelog-release-date.js

@@ -6,6 +6,8 @@
 const fs = require('fs');
 const cp = require('child_process');
 
+const suffix = process.env.PRERELEASE_SUFFIX || 'rc';
+
 const changelog = fs.readFileSync('CHANGELOG.md', 'utf8');
 
 // The changelog entry to be updated looks like this:
@@ -13,18 +15,20 @@ const changelog = fs.readFileSync('CHANGELOG.md', 'utf8');
 // 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)
 
-const unreleased = /^## Unreleased$/im;
+const pkg = require('../../package.json');
+const version = pkg.version.replace(new RegExp('-' + suffix + '\\..*'), '');
+
+const header = new RegExp(`^## (Unreleased|${version})$`, 'm');
 
-if (!unreleased.test(changelog)) {
+if (!header.test(changelog)) {
   console.error('Missing changelog entry');
   process.exit(1);
 }
 
-const { version } = require('../../package.json');
+const newHeader = pkg.version.indexOf(suffix) === -1
+  ? `## ${version} (${new Date().toISOString().split('T')[0]})`
+  : `## ${version}`;
 
-fs.writeFileSync('CHANGELOG.md', changelog.replace(
-  unreleased,
-  `## ${version} (${new Date().toISOString().split('T')[0]})`),
-);
+fs.writeFileSync('CHANGELOG.md', changelog.replace(header, newHeader));
 
 cp.execSync('git add CHANGELOG.md', { stdio: 'inherit' });