Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Simplify standard postpublish script and remove them from some privat… #382

Merged
merged 2 commits into from
Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/0x.js/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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...');
Expand Down
12 changes: 1 addition & 11 deletions packages/abi-gen/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
12 changes: 1 addition & 11 deletions packages/assert/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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);
12 changes: 1 addition & 11 deletions packages/chai-typescript-typings/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
36 changes: 1 addition & 35 deletions packages/deployer/scripts/postpublish.js
Original file line number Diff line number Diff line change
@@ -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);
12 changes: 1 addition & 11 deletions packages/dev-utils/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
12 changes: 1 addition & 11 deletions packages/json-schemas/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
15 changes: 0 additions & 15 deletions packages/monorepo-scripts/scripts/postpublish.js

This file was deleted.

11 changes: 1 addition & 10 deletions packages/subproviders/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
15 changes: 0 additions & 15 deletions packages/testnet-faucets/scripts/postpublish.js

This file was deleted.

11 changes: 1 addition & 10 deletions packages/tslint-config/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
11 changes: 1 addition & 10 deletions packages/types/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
11 changes: 1 addition & 10 deletions packages/utils/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
12 changes: 1 addition & 11 deletions packages/web3-typescript-typings/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
11 changes: 1 addition & 10 deletions packages/web3-wrapper/scripts/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
13 changes: 12 additions & 1 deletion scripts/postpublish_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
};