bin/release.js
function finishRelease() {

  log.done();
  execSync("npm run examples", {stdio: "inherit"});
  execSync("npm run docs", {stdio: "inherit"});
  let commits = "", releaseUrl = "", zipSize = 0;

  log.timer("compiling release notes");
  execAsync("git log --pretty=format:'* %s (%h)' `git describe --tags --abbrev=0`...HEAD")
    .then(stdout => {
      commits = stdout;
      log.timer("publishing npm package");
      return execAsync("npm publish ./");
    })
    .then(() => {
      log.timer("commiting all modified files for release");
      return execAsync("git add --all");
    })
    .then(() => execAsync(`git commit -m \"compiles v${version}\"`))
    .then(() => {
      log.timer("tagging latest commit");
      return execAsync(`git tag v${version}`);
    })
    .then(() => {
      log.timer("pushing to repository");
      return execAsync("git push origin --follow-tags");
    })
    .then(() => {
      log.timer("publishing release notes");
      github.authenticate({type: "oauth", token});
      return github.repos.createRelease({
        owner: "d3plus",
        repo: name,
        tag_name: `v${version}`,
        name: `v${version}`,
        body: commits,
        prerelease
      });
    })
    .then(() => {
      log.timer("attaching .zip distribution to release");
      return github.repos.getReleaseByTag({
        owner: "d3plus",
        repo: name,
        tag: `v${version}`
      });
    })
    .then(release => {
      releaseUrl = release.data.upload_url;
      zipSize = fs.statSync(`build/${name}.zip`).size;

      return github.repos.uploadAsset({
        url: releaseUrl,
        file: fs.createReadStream(`build/${name}.zip`),
        contentType: "application/zip",
        contentLength: zipSize,
        name: `${name}.zip`,
        label: `${name}.zip`,
        owner: "d3plus",
        repo: name
      });

    })
    .then(() => {
      log.exit();
      shell.exit(0);
    })
    .catch(err => {
      log.fail(err);
      log.exit();
      shell.exit(1);
    });

}
function finishRelease() {

  log.done();
  execSync("npm run examples", {stdio: "inherit"});
  execSync("npm run docs", {stdio: "inherit"});
  let commits = "", releaseUrl = "", zipSize = 0;

  log.timer("compiling release notes");
  execAsync("git log --pretty=format:'* %s (%h)' `git describe --tags --abbrev=0`...HEAD")
    .then(stdout => {
      commits = stdout;
      log.timer("publishing npm package");
      return execAsync("npm publish ./");
    })
    .then(() => {
      log.timer("commiting all modified files for release");
      return execAsync("git add --all");
    })
    .then(() => execAsync(`git commit -m \"compiles v${version}\"`))
    .then(() => {
      log.timer("tagging latest commit");
      return execAsync(`git tag v${version}`);
    })
    .then(() => {
      log.timer("pushing to repository");
      return execAsync("git push origin --follow-tags");
    })
    .then(() => {
      log.timer("publishing release notes");
      github.authenticate({type: "oauth", token});
      return github.repos.createRelease({
        owner: "d3plus",
        repo: name,
        tag_name: `v${version}`,
        name: `v${version}`,
        body: commits,
        prerelease
      });
    })
    .then(() => {
      log.timer("attaching .zip distribution to release");
      return github.repos.getReleaseByTag({
        owner: "d3plus",
        repo: name,
        tag: `v${version}`
      });
    })
    .then(release => {
      releaseUrl = release.data.upload_url;
      zipSize = fs.statSync(`build/${name}.zip`).size;

      return github.repos.uploadAsset({
        url: releaseUrl,
        file: fs.createReadStream(`build/${name}.zip`),
        contentType: "application/zip",
        contentLength: zipSize,
        name: `${name}.zip`,
        label: `${name}.zip`,
        owner: "d3plus",
        repo: name
      });

    })
    .then(() => {
      log.exit();
      shell.exit(0);
    })
    .catch(err => {
      log.fail(err);
      log.exit();
      shell.exit(1);
    });

}
function finishRelease ( ) { log . done ( ) ; execSync ( "npm run examples" , { stdio : "inherit" } ) ; execSync ( "npm run docs" , { stdio : "inherit" } ) ; let commits = "" , releaseUrl = "" , zipSize = 0 ; log . timer ( "compiling release notes" ) ; execAsync ( "git log --pretty=format:'* %s (%h)' `git describe --tags --abbrev=0`...HEAD" ) . then ( stdout => { commits = stdout ; log . timer ( "publishing npm package" ) ; return execAsync ( "npm publish ./" ) ; } ) . then ( ( ) => { log . timer ( "commiting all modified files for release" ) ; return execAsync ( "git add --all" ) ; } ) . then ( ( ) => execAsync ( ` \" ${ version } \" ` ) ) . then ( ( ) => { log . timer ( "tagging latest commit" ) ; return execAsync ( ` ${ version } ` ) ; } ) . then ( ( ) => { log . timer ( "pushing to repository" ) ; return execAsync ( "git push origin --follow-tags" ) ; } ) . then ( ( ) => { log . timer ( "publishing release notes" ) ; github . authenticate ( { type : "oauth" , token } ) ; return github . repos . createRelease ( { owner : "d3plus" , repo : name , tag_name : ` ${ version } ` , name : ` ${ version } ` , body : commits , prerelease } ) ; } ) . then ( ( ) => { log . timer ( "attaching .zip distribution to release" ) ; return github . repos . getReleaseByTag ( { owner : "d3plus" , repo : name , tag : ` ${ version } ` } ) ; } ) . then ( release => { releaseUrl = release . data . upload_url ; zipSize = fs . statSync ( ` ${ name } ` ) . size ; return github . repos . uploadAsset ( { url : releaseUrl , file : fs . createReadStream ( ` ${ name } ` ) , contentType : "application/zip" , contentLength : zipSize , name : ` ${ name } ` , label : ` ${ name } ` , owner : "d3plus" , repo : name } ) ; } ) . then ( ( ) => { log . exit ( ) ; shell . exit ( 0 ) ; } ) . catch ( err => { log . fail ( err ) ; log . exit ( ) ; shell . exit ( 1 ) ; } ) ; }
Final steps for release.
@private
Final steps for release .