"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tools/release/publish-release.ts" between
material2-7.3.2.tar.gz and material2-7.3.3.tar.gz

About: material2 offers Material Design components for Angular.

publish-release.ts  (material2-7.3.2):publish-release.ts  (material2-7.3.3)
import {bold, green, italic, red, yellow} from 'chalk'; import {bold, green, italic, red, yellow} from 'chalk';
import {execSync} from 'child_process'; import {execSync} from 'child_process';
import {readFileSync} from 'fs'; import {readFileSync} from 'fs';
import {join} from 'path'; import {join} from 'path';
import {BaseReleaseTask} from './base-release-task'; import {BaseReleaseTask} from './base-release-task';
import {checkReleaseOutput} from './check-release-output'; import {checkReleaseOutput} from './check-release-output';
import {extractReleaseNotes} from './extract-release-notes'; import {extractReleaseNotes} from './extract-release-notes';
import {GitClient} from './git/git-client'; import {GitClient} from './git/git-client';
import {getGithubNewReleaseUrl} from './git/github-urls'; import {getGithubNewReleaseUrl} from './git/github-urls';
import {isNpmAuthenticated, runInteractiveNpmLogin, runNpmPublish} from './npm/n import {
pm-client'; isNpmAuthenticated,
npmLogout,
npmLoginInteractive,
npmPublish,
} from './npm/npm-client';
import {promptForNpmDistTag} from './prompt/npm-dist-tag-prompt'; import {promptForNpmDistTag} from './prompt/npm-dist-tag-prompt';
import {promptForUpstreamRemote} from './prompt/upstream-remote-prompt'; import {promptForUpstreamRemote} from './prompt/upstream-remote-prompt';
import {releasePackages} from './release-output/release-packages'; import {releasePackages} from './release-output/release-packages';
import {CHANGELOG_FILE_NAME} from './stage-release'; import {CHANGELOG_FILE_NAME} from './stage-release';
import {parseVersionName, Version} from './version-name/parse-version'; import {parseVersionName, Version} from './version-name/parse-version';
/** Maximum allowed tries to authenticate NPM. */ /** Maximum allowed tries to authenticate NPM. */
const MAX_NPM_LOGIN_TRIES = 2; const MAX_NPM_LOGIN_TRIES = 2;
/** /**
skipping to change at line 124 skipping to change at line 129
for (let packageName of releasePackages) { for (let packageName of releasePackages) {
this.publishPackageToNpm(packageName, npmDistTag); this.publishPackageToNpm(packageName, npmDistTag);
} }
const newReleaseUrl = getGithubNewReleaseUrl({ const newReleaseUrl = getGithubNewReleaseUrl({
owner: this.repositoryOwner, owner: this.repositoryOwner,
repository: this.repositoryName, repository: this.repositoryName,
tagName: newVersionName, tagName: newVersionName,
releaseTitle: releaseTitle, releaseTitle: releaseTitle,
// TODO: we cannot insert the real changelog here since the URL would beco
me
// way too large and Github would consider this as a malformed page reques
t.
body: 'Copy-paste changelog in here!'
}); });
console.log(); console.log();
console.info(green(bold(` ✓ Published all packages successfully`))); console.info(green(bold(` ✓ Published all packages successfully`)));
// Always log out of npm after releasing to prevent unintentional changes to
// any packages.
if (npmLogout()) {
console.info(green(` ✓ Logged out of npm`));
} else {
console.error(red(` ✘ Could not log out of NPM. Please manually log out
!`));
}
console.info(yellow(` ⚠ Please draft a new release of the version on Gith ub.`)); console.info(yellow(` ⚠ Please draft a new release of the version on Gith ub.`));
console.info(yellow(` ${newReleaseUrl}`)); console.info(yellow(` ${newReleaseUrl}`));
} }
/** /**
* Verifies that the latest commit on the current branch is a version bump fro m the * Verifies that the latest commit on the current branch is a version bump fro m the
* staging script. * staging script.
*/ */
private verifyLastCommitVersionBump() { private verifyLastCommitVersionBump() {
if (!/chore: bump version/.test(this.git.getCommitTitle('HEAD'))) { if (!/chore: bump version/.test(this.git.getCommitTitle('HEAD'))) {
skipping to change at line 197 skipping to change at line 214
private checkNpmAuthentication() { private checkNpmAuthentication() {
if (isNpmAuthenticated()) { if (isNpmAuthenticated()) {
console.info(green(` ✓ NPM is authenticated.`)); console.info(green(` ✓ NPM is authenticated.`));
return; return;
} }
let failedAuthentication = false; let failedAuthentication = false;
console.log(yellow(` ⚠ NPM is currently not authenticated. Running "npm l ogin"..`)); console.log(yellow(` ⚠ NPM is currently not authenticated. Running "npm l ogin"..`));
for (let i = 0; i < MAX_NPM_LOGIN_TRIES; i++) { for (let i = 0; i < MAX_NPM_LOGIN_TRIES; i++) {
if (runInteractiveNpmLogin()) { if (npmLoginInteractive()) {
// In case the user was able to login properly, we want to exit the loop as we // In case the user was able to login properly, we want to exit the loop as we
// don't need to ask for authentication again. // don't need to ask for authentication again.
break; break;
} }
failedAuthentication = true; failedAuthentication = true;
console.error(red(` ✘ Could not authenticate successfully. Please try a gain.`)); console.error(red(` ✘ Could not authenticate successfully. Please try a gain.`));
} }
if (failedAuthentication) { if (failedAuthentication) {
skipping to change at line 220 skipping to change at line 237
process.exit(1); process.exit(1);
} }
console.info(green(` ✓ Successfully authenticated NPM.`)); console.info(green(` ✓ Successfully authenticated NPM.`));
} }
/** Publishes the specified package within the given NPM dist tag. */ /** Publishes the specified package within the given NPM dist tag. */
private publishPackageToNpm(packageName: string, npmDistTag: string) { private publishPackageToNpm(packageName: string, npmDistTag: string) {
console.info(green(` ⭮ Publishing "${packageName}"..`)); console.info(green(` ⭮ Publishing "${packageName}"..`));
const errorOutput = runNpmPublish(join(this.releaseOutputPath, packageName), npmDistTag); const errorOutput = npmPublish(join(this.releaseOutputPath, packageName), np mDistTag);
if (errorOutput) { if (errorOutput) {
console.error(red(` ✘ An error occurred while publishing "${packageName }".`)); console.error(red(` ✘ An error occurred while publishing "${packageName }".`));
console.error(red(` Please check the terminal output and reach out to the team.`)); console.error(red(` Please check the terminal output and reach out to the team.`));
console.error(red(`\n${errorOutput}`)); console.error(red(`\n${errorOutput}`));
process.exit(1); process.exit(1);
} }
console.info(green(` ✓ Successfully published "${packageName}"`)); console.info(green(` ✓ Successfully published "${packageName}"`));
} }
 End of changes. 5 change blocks. 
4 lines changed or deleted 23 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)