@@ -66,7 +66,7 @@ Assuming that this means we need to upload this package.`);
66
66
if ( upload ) {
67
67
if ( process . env . NODE_AUTH_TOKEN ) {
68
68
const publish = spawnSync ( "npm" , [ "publish" , "--access" , "public" ] , {
69
- cwd : join ( generatedDir , "packages" , dirName ) ,
69
+ cwd : join ( generatedDir , dirName ) ,
70
70
stdio : "inherit" ,
71
71
} ) ;
72
72
@@ -79,6 +79,11 @@ Assuming that this means we need to upload this package.`);
79
79
80
80
await createRelease ( `${ pkgJSON . name } @${ pkgJSON . version } ` ) ;
81
81
}
82
+ } else {
83
+ console . log (
84
+ "Wanting to run: 'npm publish --access public' in " +
85
+ join ( generatedDir , dirName )
86
+ ) ;
82
87
}
83
88
84
89
uploaded . push ( dirName ) ;
@@ -103,12 +108,18 @@ async function createRelease(tag) {
103
108
const authToken = process . env . GITHUB_TOKEN || process . env . GITHUB_API_TOKEN ;
104
109
const octokit = new Octokit ( { auth : authToken } ) ;
105
110
106
- await octokit . request ( "POST /repos/{owner}/{repo}/releases" , {
107
- owner : "microsoft" ,
108
- repo : "TypeScript-DOM-lib-generator" ,
109
- tag_name : tag ,
110
- target_commitish : process . env . GITHUB_SHA ,
111
- } ) ;
111
+ try {
112
+ await octokit . request ( "POST /repos/{owner}/{repo}/releases" , {
113
+ owner : "microsoft" ,
114
+ repo : "TypeScript-DOM-lib-generator" ,
115
+ tag_name : tag ,
116
+ target_commitish : process . env . GITHUB_SHA ,
117
+ } ) ;
118
+ } catch ( error ) {
119
+ console . error (
120
+ "Creating the GitHub release failed, this is likely due to re-running the deploy."
121
+ ) ;
122
+ }
112
123
}
113
124
114
125
go ( ) ;
0 commit comments