|
231 | 231 | "nightly": 2, |
232 | 232 | "release": 5 |
233 | 233 | } |
| 234 | + findBy: |
| 235 | + # findBy of artifacts action as json |
| 236 | + type: string |
| 237 | + default: "" |
234 | 238 | secrets: |
235 | 239 | GPG_PRIVATE_KEY: {} |
236 | 240 | jobs: |
@@ -281,24 +285,35 @@ jobs: |
281 | 285 | console.log("Previous index is unavailable"); |
282 | 286 | } |
283 | 287 | const artifactClient = new artifact.DefaultArtifactClient() |
| 288 | + var findByData = JSON.parse(${{ tojson(inputs.findBy || 'null') }}); |
| 289 | + if(findByData && !findByData.token) { |
| 290 | + findByData.token = ${{ tojson(github.token) }}; |
| 291 | + } |
284 | 292 | const listArtifactResponse = await artifactClient.listArtifacts({ |
285 | | - latest: true |
| 293 | + latest: true, |
| 294 | + findBy: findByData |
286 | 295 | }) |
287 | | - let artifacts = listArtifactResponse.artifacts |
288 | | -
|
| 296 | + let artifacts = listArtifactResponse.artifacts; |
| 297 | + |
| 298 | + console.log(JSON.stringify(artifacts)) |
289 | 299 | for(var repo of config) { |
290 | 300 | try { |
291 | 301 | const path = `packages/${repo.artifact}` |
292 | 302 | const options = { |
293 | 303 | createArtifactFolder: false |
294 | 304 | } |
| 305 | + console.log("downloading " + repo.artifact + " to " + path) |
295 | 306 |
|
296 | | - for(var artifactName of artifacts.map(artifact => artifact.name).filter(name => name === repo.artifact || name && name.startsWith(repo.artifact + "-"))) { |
297 | | -
|
298 | | - const downloadResponse = await artifactClient.downloadArtifact(artifactName, path, options) |
| 307 | + for(var art of artifacts.filter(a => a.name === repo.artifact || a.name && artifact.name.startsWith(a.artifact + "-"))) { |
| 308 | + try { |
| 309 | + console.log(JSON.stringify({art.name, path, options})); |
| 310 | + const downloadResponse = await artifactClient.downloadArtifact(art.name, path, options); |
| 311 | + } catch(err) { |
| 312 | + console.log(err) |
| 313 | + } |
299 | 314 | } |
300 | | - } catch { |
301 | | -
|
| 315 | + } catch(err) { |
| 316 | + console.log(err) |
302 | 317 | } |
303 | 318 | } |
304 | 319 | const globber = await glob.create("packages/**", { matchDirectories: false }); |
|
0 commit comments