diff options
author | Brandon Millman <brandon@0xproject.com> | 2018-02-10 02:19:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-10 02:19:33 +0800 |
commit | 58f1939ec1d3b894b6508b06ed8f276c5d1a462d (patch) | |
tree | 7573bd906a1f730981ae00fefc006bdf6624c95b | |
parent | 936f6ac10fe55257d846204ce4e5bd39ca27c78d (diff) | |
parent | d7a7e28925257860b4fea9c523eb46c8b98ab511 (diff) | |
download | dexon-sol-tools-58f1939ec1d3b894b6508b06ed8f276c5d1a462d.tar.gz dexon-sol-tools-58f1939ec1d3b894b6508b06ed8f276c5d1a462d.tar.zst dexon-sol-tools-58f1939ec1d3b894b6508b06ed8f276c5d1a462d.zip |
Merge pull request #382 from 0xProject/feature/clean-post-publish-scripts
Simplify standard postpublish script and remove them from some privat…
-rw-r--r-- | packages/0x.js/scripts/postpublish.js | 2 | ||||
-rw-r--r-- | packages/abi-gen/scripts/postpublish.js | 12 | ||||
-rw-r--r-- | packages/assert/scripts/postpublish.js | 12 | ||||
-rw-r--r-- | packages/chai-as-promised-typescript-typings/scripts/postpublish.js | 12 | ||||
-rw-r--r-- | packages/chai-typescript-typings/scripts/postpublish.js | 12 | ||||
-rw-r--r-- | packages/deployer/scripts/postpublish.js | 36 | ||||
-rw-r--r-- | packages/dev-utils/scripts/postpublish.js | 12 | ||||
-rw-r--r-- | packages/json-schemas/scripts/postpublish.js | 12 | ||||
-rw-r--r-- | packages/monorepo-scripts/scripts/postpublish.js | 15 | ||||
-rw-r--r-- | packages/subproviders/scripts/postpublish.js | 11 | ||||
-rw-r--r-- | packages/testnet-faucets/scripts/postpublish.js | 15 | ||||
-rw-r--r-- | packages/tslint-config/scripts/postpublish.js | 11 | ||||
-rw-r--r-- | packages/types/scripts/postpublish.js | 11 | ||||
-rw-r--r-- | packages/utils/scripts/postpublish.js | 11 | ||||
-rw-r--r-- | packages/web3-typescript-typings/scripts/postpublish.js | 12 | ||||
-rw-r--r-- | packages/web3-wrapper/scripts/postpublish.js | 11 | ||||
-rw-r--r-- | scripts/postpublish_utils.js | 13 |
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..7ce01189c 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 this.getLatestTagAndVersionAsync(subPackageName) + .then(function(result) { + const releaseName = this.getReleaseName(subPackageName, result.version); + const assets = []; + return this.publishReleaseNotesAsync(result.tag, releaseName, assets); + }.bind(this)) + .catch(function(err) { + throw err; + }); + }, generatedDocsDirectoryName, }; |