aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-02-09 03:23:37 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-02-09 03:46:33 +0800
commit6dec29e214e6c9f222a7673efd97d21b3952b090 (patch)
tree400a52739b2171a49c2ffd8fd452190e04807ff9
parent254d3f53e2cd09eed3eb6b8ce841f546d01dcdcd (diff)
downloaddexon-sol-tools-6dec29e214e6c9f222a7673efd97d21b3952b090.tar
dexon-sol-tools-6dec29e214e6c9f222a7673efd97d21b3952b090.tar.gz
dexon-sol-tools-6dec29e214e6c9f222a7673efd97d21b3952b090.tar.bz2
dexon-sol-tools-6dec29e214e6c9f222a7673efd97d21b3952b090.tar.lz
dexon-sol-tools-6dec29e214e6c9f222a7673efd97d21b3952b090.tar.xz
dexon-sol-tools-6dec29e214e6c9f222a7673efd97d21b3952b090.tar.zst
dexon-sol-tools-6dec29e214e6c9f222a7673efd97d21b3952b090.zip
Simplify standard postpublish script and remove them from some private packages
-rw-r--r--packages/0x.js/scripts/postpublish.js2
-rw-r--r--packages/abi-gen/scripts/postpublish.js12
-rw-r--r--packages/assert/scripts/postpublish.js12
-rw-r--r--packages/chai-as-promised-typescript-typings/scripts/postpublish.js12
-rw-r--r--packages/chai-typescript-typings/scripts/postpublish.js12
-rw-r--r--packages/deployer/scripts/postpublish.js36
-rw-r--r--packages/dev-utils/scripts/postpublish.js12
-rw-r--r--packages/json-schemas/scripts/postpublish.js12
-rw-r--r--packages/monorepo-scripts/scripts/postpublish.js15
-rw-r--r--packages/subproviders/scripts/postpublish.js11
-rw-r--r--packages/testnet-faucets/scripts/postpublish.js15
-rw-r--r--packages/tslint-config/scripts/postpublish.js11
-rw-r--r--packages/types/scripts/postpublish.js11
-rw-r--r--packages/utils/scripts/postpublish.js11
-rw-r--r--packages/web3-typescript-typings/scripts/postpublish.js12
-rw-r--r--packages/web3-wrapper/scripts/postpublish.js11
-rw-r--r--scripts/postpublish_utils.js13
17 files changed, 26 insertions, 194 deletions
diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js
index 1be964478..7cbabd8f6 100644
--- a/packages/0x.js/scripts/postpublish.js
+++ b/packages/0x.js/scripts/postpublish.js
@@ -15,7 +15,7 @@ postpublish_utils
version = result.version;
const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
const assets = [__dirname + '/../_bundles/index.js', __dirname + '/../_bundles/index.min.js'];
- return postpublish_utils.publishReleaseNotes(tag, releaseName, assets);
+ return postpublish_utils.publishReleaseNotesAsync(tag, releaseName, assets);
})
.then(function(release) {
console.log('POSTPUBLISH: Release successful, generating docs...');
diff --git a/packages/abi-gen/scripts/postpublish.js b/packages/abi-gen/scripts/postpublish.js
index 16d67e03f..b3e5407c8 100644
--- a/packages/abi-gen/scripts/postpublish.js
+++ b/packages/abi-gen/scripts/postpublish.js
@@ -2,14 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils
- .getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch(function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/assert/scripts/postpublish.js b/packages/assert/scripts/postpublish.js
index 16d67e03f..b3e5407c8 100644
--- a/packages/assert/scripts/postpublish.js
+++ b/packages/assert/scripts/postpublish.js
@@ -2,14 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils
- .getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch(function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/chai-as-promised-typescript-typings/scripts/postpublish.js b/packages/chai-as-promised-typescript-typings/scripts/postpublish.js
index 16d67e03f..b3e5407c8 100644
--- a/packages/chai-as-promised-typescript-typings/scripts/postpublish.js
+++ b/packages/chai-as-promised-typescript-typings/scripts/postpublish.js
@@ -2,14 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils
- .getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch(function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/chai-typescript-typings/scripts/postpublish.js b/packages/chai-typescript-typings/scripts/postpublish.js
index 16d67e03f..b3e5407c8 100644
--- a/packages/chai-typescript-typings/scripts/postpublish.js
+++ b/packages/chai-typescript-typings/scripts/postpublish.js
@@ -2,14 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils
- .getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch(function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/deployer/scripts/postpublish.js b/packages/deployer/scripts/postpublish.js
index 24384b228..b3e5407c8 100644
--- a/packages/deployer/scripts/postpublish.js
+++ b/packages/deployer/scripts/postpublish.js
@@ -1,39 +1,5 @@
-const execAsync = require('async-child-process').execAsync;
const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
-const cwd = __dirname + '/..';
const subPackageName = packageJSON.name;
-const S3BucketPath = 's3://connect-docs-jsons/';
-
-let tag;
-let version;
-postpublish_utils
- .getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- tag = result.tag;
- version = result.version;
- const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
- return postpublish_utils.publishReleaseNotes(tag, releaseName);
- })
- .then(function(release) {
- console.log('POSTPUBLISH: Release successful, generating docs...');
- const jsonFilePath = __dirname + '/../' + postpublish_utils.generatedDocsDirectoryName + '/index.json';
- return execAsync('JSON_FILE_PATH=' + jsonFilePath + ' PROJECT_DIR=' + __dirname + '/.. yarn docs:json', {
- cwd,
- });
- })
- .then(function(result) {
- if (result.stderr !== '') {
- throw new Error(result.stderr);
- }
- const fileName = 'v' + version + '.json';
- console.log('POSTPUBLISH: Doc generation successful, uploading docs... as ', fileName);
- const s3Url = S3BucketPath + fileName;
- return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', {
- cwd,
- });
- })
- .catch(function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/dev-utils/scripts/postpublish.js b/packages/dev-utils/scripts/postpublish.js
index 16d67e03f..b3e5407c8 100644
--- a/packages/dev-utils/scripts/postpublish.js
+++ b/packages/dev-utils/scripts/postpublish.js
@@ -2,14 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils
- .getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch(function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/json-schemas/scripts/postpublish.js b/packages/json-schemas/scripts/postpublish.js
index 16d67e03f..b3e5407c8 100644
--- a/packages/json-schemas/scripts/postpublish.js
+++ b/packages/json-schemas/scripts/postpublish.js
@@ -2,14 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils
- .getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch(function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/monorepo-scripts/scripts/postpublish.js b/packages/monorepo-scripts/scripts/postpublish.js
deleted file mode 100644
index 16d67e03f..000000000
--- a/packages/monorepo-scripts/scripts/postpublish.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const postpublish_utils = require('../../../scripts/postpublish_utils');
-const packageJSON = require('../package.json');
-
-const subPackageName = packageJSON.name;
-
-postpublish_utils
- .getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch(function(err) {
- throw err;
- });
diff --git a/packages/subproviders/scripts/postpublish.js b/packages/subproviders/scripts/postpublish.js
index 7fa452b08..b3e5407c8 100644
--- a/packages/subproviders/scripts/postpublish.js
+++ b/packages/subproviders/scripts/postpublish.js
@@ -2,13 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch (function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/testnet-faucets/scripts/postpublish.js b/packages/testnet-faucets/scripts/postpublish.js
deleted file mode 100644
index 16d67e03f..000000000
--- a/packages/testnet-faucets/scripts/postpublish.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const postpublish_utils = require('../../../scripts/postpublish_utils');
-const packageJSON = require('../package.json');
-
-const subPackageName = packageJSON.name;
-
-postpublish_utils
- .getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch(function(err) {
- throw err;
- });
diff --git a/packages/tslint-config/scripts/postpublish.js b/packages/tslint-config/scripts/postpublish.js
index 7fa452b08..b3e5407c8 100644
--- a/packages/tslint-config/scripts/postpublish.js
+++ b/packages/tslint-config/scripts/postpublish.js
@@ -2,13 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch (function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/types/scripts/postpublish.js b/packages/types/scripts/postpublish.js
index 7fa452b08..b3e5407c8 100644
--- a/packages/types/scripts/postpublish.js
+++ b/packages/types/scripts/postpublish.js
@@ -2,13 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch (function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/utils/scripts/postpublish.js b/packages/utils/scripts/postpublish.js
index 7fa452b08..b3e5407c8 100644
--- a/packages/utils/scripts/postpublish.js
+++ b/packages/utils/scripts/postpublish.js
@@ -2,13 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch (function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/web3-typescript-typings/scripts/postpublish.js b/packages/web3-typescript-typings/scripts/postpublish.js
index 16d67e03f..b3e5407c8 100644
--- a/packages/web3-typescript-typings/scripts/postpublish.js
+++ b/packages/web3-typescript-typings/scripts/postpublish.js
@@ -2,14 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils
- .getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch(function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/packages/web3-wrapper/scripts/postpublish.js b/packages/web3-wrapper/scripts/postpublish.js
index 7fa452b08..b3e5407c8 100644
--- a/packages/web3-wrapper/scripts/postpublish.js
+++ b/packages/web3-wrapper/scripts/postpublish.js
@@ -2,13 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
-
-postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch (function(err) {
- throw err;
- });
+postpublish_utils.standardPostPublishAsync(subPackageName); \ No newline at end of file
diff --git a/scripts/postpublish_utils.js b/scripts/postpublish_utils.js
index c4ca917da..9603827db 100644
--- a/scripts/postpublish_utils.js
+++ b/scripts/postpublish_utils.js
@@ -29,7 +29,7 @@ module.exports = {
};
});
},
- publishReleaseNotes: function(tag, releaseName, assets) {
+ publishReleaseNotesAsync: function(tag, releaseName, assets) {
console.log('POSTPUBLISH: Releasing ', releaseName, '...');
return publishReleaseAsync({
token: githubPersonalAccessToken,
@@ -49,5 +49,16 @@ module.exports = {
const releaseName = subPackageName + ' v' + version;
return releaseName;
},
+ standardPostPublishAsync: function(subPackageName) {
+ return getLatestTagAndVersionAsync(subPackageName)
+ .then(function(result) {
+ const releaseName = getReleaseName(subPackageName, result.version);
+ const assets = [];
+ return publishReleaseNotesAsync(result.tag, releaseName, assets);
+ })
+ .catch(function(err) {
+ throw err;
+ });
+ },
generatedDocsDirectoryName,
};