@@ -26,6 +26,7 @@ const releaseToGithub = async(version: string, artifact: string, platform: strin
26
26
if ( semver . gt ( version , latestRelease . tag_name . replace ( 'v' , '' ) ) ) {
27
27
// Create a new release if our version is higher than latest.
28
28
const newRelease = await createRelease ( version , octokit ) ;
29
+ // TODO: Durran - Sign and notarize for MacOS here instead of before.
29
30
await uploadAsset ( artifact , platform , newRelease . upload_url , octokit ) ;
30
31
return true ;
31
32
} else {
@@ -76,7 +77,7 @@ const createRelease = async(version: string, octokit: Octokit): Promise<any> =>
76
77
* @param {string } uploadUrl - The release endpoint.
77
78
* @param {Octokit } octokit - The octokit instance.
78
79
*/
79
- const uploadAsset = ( artifact : string , platform : string , uploadUrl : string , octokit : Octokit ) : Promise < any > => {
80
+ const uploadAsset = async ( artifact : string , platform : string , uploadUrl : string , octokit : Octokit ) Promise < any > => {
80
81
const params = {
81
82
method : 'POST' ,
82
83
url : uploadUrl ,
@@ -87,7 +88,7 @@ const uploadAsset = (artifact: string, platform: string, uploadUrl: string, octo
87
88
data : fs . readFileSync ( artifact )
88
89
} ;
89
90
console . log ( 'mongosh: uploading asset to github:' , artifact ) ;
90
- return octokit . request ( params ) . catch ( ( e ) => {
91
+ await octokit . request ( params ) . catch ( ( e ) => {
91
92
// If the asset already exists it will throw, but we just log
92
93
// it since we don't want to overwrite assets.
93
94
console . log ( 'mongosh: asset already exists:' , e ) ;
0 commit comments