@@ -113,10 +113,12 @@ async function jsonRequest(url) {
113
113
*/
114
114
async function fetchMatchingGithubRelease ( repo , releaseMatchers ) {
115
115
/** @type {Array<object> } */
116
- const releaseInfos = await jsonRequest ( `https://api.github.com/repos/${ repo } /releases` ) ;
116
+ const releaseInfos = await jsonRequest ( `https://api.github.com/repos/${ repo } /releases?per_page=100 ` ) ;
117
117
if ( ! releaseInfos || ! releaseInfos . length ) {
118
118
throw new Error ( `Invalid release info for ${ repo } ` ) ;
119
119
}
120
+ // Sort by created_at (required since glslang's CI replaces assets on the same release ID)
121
+ releaseInfos . sort ( ( { created_at : a } , { created_at : b } ) => a ? b ? ( new Date ( b ) - new Date ( a ) ) : - 1 : 1 ) ;
120
122
let foundReleaseInfo ;
121
123
for ( const releaseInfo of releaseInfos ) {
122
124
if ( releaseInfo . draft || // Skip draft releases
@@ -214,7 +216,7 @@ async function fetchMatchingSpirvToolsCI(urls, releaseMatchers) {
214
216
}
215
217
version = assetVersion ;
216
218
}
217
- return { version, tag : version , platforms} ;
219
+ return { version, tag : version , url : '' , platforms} ;
218
220
}
219
221
220
222
( async function main ( ) {
@@ -246,6 +248,7 @@ async function fetchMatchingSpirvToolsCI(urls, releaseMatchers) {
246
248
for ( const target of buildConfig . targets ) {
247
249
if ( ! sourceResult . platforms [ target ] ) throw new Error ( `source '${ source . name } ' missing target '${ target } '` ) ;
248
250
}
251
+ console . log ( `source '${ source . name } ' - chose '${ sourceResult . tag } ' (${ sourceResult . url } )` ) ;
249
252
sources . push ( { ...sourceResult , name : source . name , filelist : source . filelist ,
250
253
verargs : source . verargs , vermatch : source . vermatch } ) ;
251
254
}
0 commit comments