1- import { green , grey , red , yellow } from 'chalk' ;
1+ import { green , grey , yellow } from 'chalk' ;
22import { spawn } from 'child_process' ;
33import { existsSync , statSync } from 'fs-extra' ;
44import { task } from 'gulp' ;
55import { buildConfig , sequenceTask } from 'material2-build-tools' ;
66import * as minimist from 'minimist' ;
77import { join } from 'path' ;
88import { execTask } from '../../util/task_helpers' ;
9- import { checkPublishBranch , versionNameRegex } from './branch-check' ;
109
1110/** Packages that will be published to NPM by the release task. */
1211export const releasePackages = [
@@ -21,9 +20,9 @@ export const releasePackages = [
2120const argv = minimist ( process . argv . slice ( 3 ) ) ;
2221
2322task ( 'publish' , sequenceTask (
23+ ':publish:sanity-checks' ,
2424 ':publish:whoami' ,
2525 ':publish:build-releases' ,
26- 'validate-release:check-remote-tag' ,
2726 'validate-release:check-bundles' ,
2827 ':publish' ,
2928 ':publish:logout' ,
@@ -48,14 +47,6 @@ task(':publish', async () => {
4847 const version = buildConfig . projectVersion ;
4948 const currentDir = process . cwd ( ) ;
5049
51- if ( ! version . match ( versionNameRegex ) ) {
52- console . error ( red ( `Error: Cannot publish due to an invalid version name. Version ` +
53- `"${ version } " is not following our semver format.` ) ) ;
54- console . error ( yellow ( `A version should follow this format: X.X.X, X.X.X-beta.X, ` +
55- `X.X.X-alpha.X, X.X.X-rc.X` ) ) ;
56- return ;
57- }
58-
5950 console . log ( ) ;
6051 if ( ! tag ) {
6152 console . log ( grey ( '> You can specify the tag by passing --tag=labelName.\n' ) ) ;
@@ -65,21 +56,12 @@ task(':publish', async () => {
6556 }
6657 console . log ( ) ;
6758
68- if ( version . match ( / ( a l p h a | b e t a | r c ) / ) && ( ! tag || tag === 'latest' ) ) {
69- console . error ( red ( `Publishing ${ version } to the "latest" tag is not allowed.` ) ) ;
70- console . error ( red ( `Alpha, Beta or RC versions shouldn't be published to "latest".` ) ) ;
71- console . error ( ) ;
72- return ;
73- }
74-
7559 if ( releasePackages . length > 1 ) {
7660 console . warn ( yellow ( 'Warning: Multiple packages will be released.' ) ) ;
7761 console . warn ( yellow ( 'Warning: Packages to be released:' , releasePackages . join ( ', ' ) ) ) ;
7862 console . warn ( ) ;
7963 }
8064
81- checkPublishBranch ( version ) ;
82-
8365 console . log ( yellow ( '> Make sure to check the "requiredAngularVersion" in the package.json.' ) ) ;
8466 console . log ( yellow ( '> The version in the config defines the peer dependency of Angular.' ) ) ;
8567 console . log ( ) ;
0 commit comments