From 01de87165375f74f53be2b13dc9eeadb87b4bee6 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 11 Dec 2018 19:33:21 -0300 Subject: [PATCH 1/4] remove note that was fixed in #1526 --- RELEASING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index 7ef7f098f64..1cafeeb3d5e 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -37,7 +37,7 @@ Draft the release notes in our [GitHub releases](https://github.com/OpenZeppelin Before publishing on npm you need to generate the build artifacts. This is not done automatically at the moment because of a bug in Truffle. Since some of the contracts should not be included in the package, this is a _hairy_ process that you need to do with care. 1. Delete the `contracts/mocks`, `contracts/examples` and `build` directories. -2. Run `truffle compile`. (Note that the Truffle process may never exit and you will have to interrupt it.) +2. Run `truffle compile`. 3. Recover the directories using `git checkout`. It doesn't matter if you do this now or later. Once the CI run for the new tag is green, publish on npm under the `next` tag. @@ -71,7 +71,7 @@ Draft the release notes in GitHub releases. Try to be consistent with our previo Before publishing on npm you need to generate the build artifacts. This is not done automatically at the moment because of a bug in Truffle. Since some of the contracts should not be included in the package, this is a _hairy_ process that you need to do with care. 1. Delete the `contracts/mocks`, `contracts/examples` and `build` directories. -2. Run `truffle compile`. (Note that the Truffle process may never exit and you will have to interrupt it.) +2. Run `truffle compile`. 3. Recover the directories using `git checkout`. It doesn't matter if you do this now or later. Once the CI run for the new tag is green, publish on npm. From 733991b1ade340f4fe6a2273dbf9c1c54bdc6873 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 11 Dec 2018 19:34:10 -0300 Subject: [PATCH 2/4] add build script --- package.json | 3 ++- scripts/build.sh | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 scripts/build.sh diff --git a/package.json b/package.json index fa030dfc5be..27106b03578 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "lint:fix": "npm run lint:js:fix && npm run lint:sol:fix", "console": "truffle console", "coverage": "scripts/coverage.sh", - "version": "scripts/version.js" + "version": "scripts/version.js", + "build": "scripts/build.sh" }, "repository": { "type": "git", diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 00000000000..f48b92d065e --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Configure to exit script as soon as a command fails. +set -o errexit + +# Clean the existing build directory. +rm -rf build + +# Create a temporary directory to place ignored files (e.g. examples). +tmp_dir="$(mktemp -dp.)" + +# Move the ignored files to the temporary directory. +while IFS="" read -r ignored +do + mv "contracts/$ignored" "$tmp_dir" +done < contracts/.npmignore + +# Compile everything else. +node_modules/.bin/truffle compile + +# Return ignored files to their place. +mv "$tmp_dir/"* contracts/ + +# Delete the temporary directory. +rmdir "$tmp_dir" From 9550250ac4e5fb0825b127f0f12c985f52d27da6 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 11 Dec 2018 19:40:45 -0300 Subject: [PATCH 3/4] add prepack script --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 27106b03578..f4b6b0fbc23 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "console": "truffle console", "coverage": "scripts/coverage.sh", "version": "scripts/version.js", - "build": "scripts/build.sh" + "build": "scripts/build.sh", + "prepack": "npm run build" }, "repository": { "type": "git", From 53c64341a9526f65091f4581f0d6259cc59193ad Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 12 Dec 2018 15:08:44 -0300 Subject: [PATCH 4/4] remove custom compilation steps --- RELEASING.md | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index 1cafeeb3d5e..20f1132ad75 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -34,13 +34,7 @@ git push upstream vX.Y.Z-rc.R Draft the release notes in our [GitHub releases](https://github.com/OpenZeppelin/openzeppelin-solidity/releases). Make sure to mark it as a pre-release! Try to be consistent with our previous release notes in the title and format of the text. Release candidates don't need a detailed changelog, but make sure to include a link to GitHub's compare page. -Before publishing on npm you need to generate the build artifacts. This is not done automatically at the moment because of a bug in Truffle. Since some of the contracts should not be included in the package, this is a _hairy_ process that you need to do with care. - -1. Delete the `contracts/mocks`, `contracts/examples` and `build` directories. -2. Run `truffle compile`. -3. Recover the directories using `git checkout`. It doesn't matter if you do this now or later. - -Once the CI run for the new tag is green, publish on npm under the `next` tag. +Once the CI run for the new tag is green, publish on npm under the `next` tag. You should see the contracts compile automatically. ``` npm publish --tag next @@ -68,13 +62,7 @@ git push upstream vX.Y.Z Draft the release notes in GitHub releases. Try to be consistent with our previous release notes in the title and format of the text. Make sure to include a detailed changelog. -Before publishing on npm you need to generate the build artifacts. This is not done automatically at the moment because of a bug in Truffle. Since some of the contracts should not be included in the package, this is a _hairy_ process that you need to do with care. - -1. Delete the `contracts/mocks`, `contracts/examples` and `build` directories. -2. Run `truffle compile`. -3. Recover the directories using `git checkout`. It doesn't matter if you do this now or later. - -Once the CI run for the new tag is green, publish on npm. +Once the CI run for the new tag is green, publish on npm. You should see the contracts compile automatically. ``` npm publish