Skip to content

Commit

Permalink
Updated admin scripts for publishing prod releases.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jun 13, 2020
1 parent 039bad3 commit e0e0dbe
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 25 deletions.
18 changes: 13 additions & 5 deletions admin/cmds/lock-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,23 @@ const { log } = require("../log");
const deps = info[key];
if (!deps) { return; }
Object.keys(deps).forEach((name) => {
if (versions[name] == null) { return; }
const value = ">=" + versions[name];
if (value !== deps[name])
if (!deps[name]) { return; }
// Not a package in this monorepoa
const version = versions[name];
if (version == null) { return; }

const value = ((version.indexOf("beta") !== -1) ? ">=": "^") + version;

// No change
if (value === deps[name]) { return; }

// Show a header for the first change
if (!shown) {
log(`<bold:Locking ${ info.name }:>`);
shown = true;
}
log(` <green:${ name }>: ${ deps[name] } => <bold:${ value.substring(2) }>`);

// Show the locked version
log(` <green:${ name }>: ${ deps[name] } => <bold:${ value.replace(">", "&gt;") }>`);
deps[name] = value;
});
});
Expand Down
35 changes: 21 additions & 14 deletions admin/cmds/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const { getPackageVersion, publish } = require("../npm");
const { log } = require("../log");

const USER_AGENT = "ethers-dist@0.0.0";
const TAG = "next";
const TAG = "latest";


let dirnames = getOrdered();
Expand Down Expand Up @@ -75,10 +75,7 @@ if (process.argv.length > 2) {
let dirname = dirnames[i];

if (dirname === "ethers") {
options.tag = "next";
includeEthers = true;
} else {
options.tag = "latest";
}

let info = loadPackage(dirname);
Expand All @@ -98,20 +95,30 @@ if (process.argv.length > 2) {
log(" <green:Done.>");
}

// Publish the GitHub release (currently beta)
const beta = true;
// Publish the GitHub release
const beta = false;
if (includeEthers) {
{
// The password above already succeeded
const username = await config.get("github-user");
const password = await config.get("github-release");

// The password above already succeeded
const username = await config.get("github-user");
const password = await config.get("github-release");
// Get the latest change from the changelog
const change = latestChange();

// Get the latest change from the changelog
const change = latestChange();
// Publish the release
const link = await createRelease(username, password, change.version, change.title, change.content, beta, gitCommit);
log(`<bold:Published Release:> ${ link }`);
}

/*
{
const accessKey = await config.get("aws-upload-scripts-accesskey");
const secretKey = await config.get("aws-upload-scripts-secretkey");
const s3 =
}
*/

// Publish the release
const link = await createRelease(username, password, change.version, change.title, change.content, beta, gitCommit);
log(`<bold:Published Release:> ${ link }`);
}

})();
6 changes: 3 additions & 3 deletions admin/cmds/spell-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ expired failed fetches formatted formatting funding generated
has ignoring implemented implementer imported including instantiate
keyword labelled larger lookup matches mined modified modifies multi
named needed nested neutered numeric offline optimizer overriding owned packed
padded parsed parsing passed placeholder processing reached
padded parsed parsing passed placeholder processing properties reached
recommended recovered redacted remaining replaced required
serializes shared signed signing skipped stored supported tagging targetted
transactions uninstall unstake unsubscribe using verifies website
Expand All @@ -42,8 +42,8 @@ jumpdest mstore shr shl xor
ABIEncoder testcase numberish Wordlist
// Common Code Strings
abi addr api app arg arrayify asm basex bigint bn byte bytecode
callback calldata checksum ciphertext cli codepoint config
abi addr api app arg arrayify asm basex bigint bignumber bn byte
bytecode callback calldata checksum ciphertext cli codepoint config
contenthash ctr ctrl debug dd dklen eexist encseed eof ethaddr
ethseed ethers eval exec filename func gz hid http https hw iv
info init ipc json kdf kdfparams labelhash lang lib mm multihash nfc
Expand Down
2 changes: 1 addition & 1 deletion admin/cmds/update-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if (process.argv.length > 2) {

// Bump the version if necessary
if (info.version === npmInfo.version) {
let newVersion = semver.inc(info.version, "prerelease", "beta");
let newVersion = semver.inc(info.version, "patch");

// Write out the _version.ts
if (!info._ethers_nobuild) {
Expand Down
4 changes: 2 additions & 2 deletions admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function runDiff(dirnames) {

// Bump the version if necessary
if (info.version === npmInfo.version) {
info.version = semver.inc(info.version, "prerelease", "beta");
info.version = semver.inc(info.version, "patch");
}

console.log(colorify("<bold:Package>: ") + info.name);
Expand Down Expand Up @@ -176,7 +176,7 @@ async function runUpdate(dirnames) {

// Bump the version if necessary
if (info.version === npmInfo.version) {
let newVersion = semver.inc(info.version, "prerelease", "beta");
let newVersion = semver.inc(info.version, "patch");

// Write out the _version.ts
if (!info._ethers_skipPrepare) {
Expand Down

0 comments on commit e0e0dbe

Please sign in to comment.