@@ -118,6 +118,9 @@ function isReleaseAsset(filename) {
118118}
119119
120120function isAutoUpdateSupportFile ( filename ) {
121+ if ( filename === 'builder-debug.yml' ) {
122+ return false ;
123+ }
121124 if ( filename . endsWith ( '.blockmap' ) ) {
122125 return true ;
123126 }
@@ -156,13 +159,28 @@ async function normaliseReleaseAsset(filePath) {
156159 const fileName = path . basename ( filePath ) ;
157160 const normalisedName = normaliseInstallerFileName ( fileName ) ;
158161 if ( normalisedName === fileName ) {
159- return { filePath, fileName } ;
162+ return { filePath, fileName, originalFileName : fileName } ;
160163 }
161164
162165 const targetPath = path . join ( path . dirname ( filePath ) , normalisedName ) ;
163166 await fs . rename ( filePath , targetPath ) ;
164167 console . log ( `Normalised release asset name: ${ fileName } -> ${ normalisedName } ` ) ;
165- return { filePath : targetPath , fileName : normalisedName } ;
168+ return { filePath : targetPath , fileName : normalisedName , originalFileName : fileName } ;
169+ }
170+
171+ async function computeSha512 ( filePath ) {
172+ return new Promise ( ( resolve , reject ) => {
173+ const hash = crypto . createHash ( 'sha512' ) ;
174+ const stream = createReadStream ( filePath ) ;
175+ stream . on ( 'data' , ( chunk ) => hash . update ( chunk ) ) ;
176+ stream . on ( 'error' , reject ) ;
177+ stream . on ( 'end' , ( ) => resolve ( hash . digest ( 'base64' ) ) ) ;
178+ } ) ;
179+ }
180+
181+ async function getFileSize ( filePath ) {
182+ const stats = await fs . stat ( filePath ) ;
183+ return stats . size ;
166184}
167185
168186async function computeSha512 ( filePath ) {
@@ -198,7 +216,7 @@ async function collectAssets(artifactRoot) {
198216 const arch = normaliseArch ( parts . slice ( 1 ) . join ( '-' ) || parts [ 0 ] ) ;
199217 const files = await walkFiles ( path . join ( artifactRoot , dirName ) ) ;
200218 for ( const file of files ) {
201- const { filePath : normalisedPath , fileName : normalisedName } = await normaliseReleaseAsset ( file ) ;
219+ const { filePath : normalisedPath , fileName : normalisedName , originalFileName } = await normaliseReleaseAsset ( file ) ;
202220 const fileName = normalisedName ;
203221 const filePath = normalisedPath ;
204222 if ( isAutoUpdateSupportFile ( fileName ) ) {
@@ -220,6 +238,7 @@ async function collectAssets(artifactRoot) {
220238 arch,
221239 fileName,
222240 filePath,
241+ originalFileName,
223242 format : detectFormat ( fileName ) ,
224243 sha512,
225244 size,
0 commit comments