@@ -19,6 +19,14 @@ export const releasePackages = [
19
19
/** Parse command-line arguments for release task. */
20
20
const argv = minimist ( process . argv . slice ( 3 ) ) ;
21
21
22
+ task ( 'publish' , sequenceTask (
23
+ ':publish:whoami' ,
24
+ ':publish:build-releases' ,
25
+ 'validate-release:check-bundles' ,
26
+ ':publish' ,
27
+ ':publish:logout' ,
28
+ ) ) ;
29
+
22
30
/** Task that builds all releases that will be published. */
23
31
task ( ':publish:build-releases' , sequenceTask (
24
32
'clean' ,
@@ -33,6 +41,37 @@ task(':publish:whoami', execTask('npm', ['whoami'], {
33
41
34
42
task ( ':publish:logout' , execTask ( 'npm' , [ 'logout' ] ) ) ;
35
43
44
+ task ( ':publish' , async ( ) => {
45
+ const label = argv [ 'tag' ] ;
46
+ const version = buildConfig . projectVersion ;
47
+ const currentDir = process . cwd ( ) ;
48
+
49
+ console . log ( '' ) ;
50
+ if ( ! label ) {
51
+ console . log ( grey ( '> You can use a label with --tag=labelName.\n' ) ) ;
52
+ console . log ( green ( `Publishing version "${ version } " using the latest tag...` ) ) ;
53
+ } else {
54
+ console . log ( yellow ( `Publishing version "${ version } " using the ${ label } tag...` ) ) ;
55
+ }
56
+ console . log ( '' ) ;
57
+
58
+ if ( releasePackages . length > 1 ) {
59
+ console . warn ( red ( 'Warning: Multiple packages will be released if proceeding.' ) ) ;
60
+ console . warn ( red ( 'Warning: Packages to be released: ' , releasePackages . join ( ', ' ) ) ) ;
61
+ console . log ( ) ;
62
+ }
63
+
64
+ console . log ( yellow ( '> Make sure to check the "angularVersion" in the build config.' ) ) ;
65
+ console . log ( yellow ( '> The version in the config defines the peer dependency of Angular.' ) ) ;
66
+ console . log ( ) ;
67
+
68
+ // Iterate over every declared release package and publish it on NPM.
69
+ for ( const packageName of releasePackages ) {
70
+ await _execNpmPublish ( label , packageName ) ;
71
+ }
72
+
73
+ process . chdir ( currentDir ) ;
74
+ } ) ;
36
75
37
76
function _execNpmPublish ( label : string , packageName : string ) : Promise < { } > | undefined {
38
77
const packageDir = join ( buildConfig . outputDir , 'releases' , packageName ) ;
@@ -83,37 +122,3 @@ function _execNpmPublish(label: string, packageName: string): Promise<{}> | unde
83
122
} ) ;
84
123
} ) ;
85
124
}
86
-
87
- task ( ':publish' , async ( ) => {
88
- const label = argv [ 'tag' ] ;
89
- const currentDir = process . cwd ( ) ;
90
-
91
- console . log ( '' ) ;
92
- if ( ! label ) {
93
- console . log ( yellow ( 'You can use a label with --tag=labelName.' ) ) ;
94
- console . log ( yellow ( 'Publishing using the latest tag.' ) ) ;
95
- } else {
96
- console . log ( yellow ( `Publishing using the ${ label } tag.` ) ) ;
97
- }
98
- console . log ( '' ) ;
99
-
100
- if ( releasePackages . length > 1 ) {
101
- console . warn ( red ( 'Warning: Multiple packages will be released if proceeding.' ) ) ;
102
- console . warn ( red ( 'Warning: Packages to be released: ' , releasePackages . join ( ', ' ) ) ) ;
103
- }
104
-
105
- // Iterate over every declared release package and publish it on NPM.
106
- for ( const packageName of releasePackages ) {
107
- await _execNpmPublish ( label , packageName ) ;
108
- }
109
-
110
- process . chdir ( currentDir ) ;
111
- } ) ;
112
-
113
- task ( 'publish' , sequenceTask (
114
- ':publish:whoami' ,
115
- ':publish:build-releases' ,
116
- 'validate-release:check-bundles' ,
117
- ':publish' ,
118
- ':publish:logout' ,
119
- ) ) ;
0 commit comments