@@ -34,7 +34,7 @@ async fn fetch_artifact(client: &Octocrab, artifact: WorkflowListArtifact) -> Re
34
34
async fn upload_release_artifact (
35
35
client : & Octocrab ,
36
36
release : & Release ,
37
- filename : & str ,
37
+ filename : String ,
38
38
data : Vec < u8 > ,
39
39
dry_run : bool ,
40
40
) -> Result < ( ) > {
@@ -50,7 +50,7 @@ async fn upload_release_artifact(
50
50
url. set_path ( path) ;
51
51
}
52
52
53
- url. query_pairs_mut ( ) . clear ( ) . append_pair ( "name" , filename) ;
53
+ url. query_pairs_mut ( ) . clear ( ) . append_pair ( "name" , & filename) ;
54
54
55
55
println ! ( "uploading to {}" , url) ;
56
56
@@ -364,6 +364,8 @@ pub async fn command_upload_release_distributions(args: &ArgMatches) -> Result<(
364
364
365
365
let mut digests = BTreeMap :: new ( ) ;
366
366
367
+ let mut fs = vec ! [ ] ;
368
+
367
369
for ( source, dest) in wanted_filenames {
368
370
if !filenames. contains ( & source) {
369
371
continue ;
@@ -378,15 +380,26 @@ pub async fn command_upload_release_distributions(args: &ArgMatches) -> Result<(
378
380
379
381
digests. insert ( dest. clone ( ) , digest. clone ( ) ) ;
380
382
381
- upload_release_artifact ( & client, & release, & dest, file_data, dry_run) . await ?;
382
- upload_release_artifact (
383
+ fs. push ( upload_release_artifact (
383
384
& client,
384
385
& release,
385
- & format ! ( "{}.sha256" , dest) ,
386
+ dest. clone ( ) ,
387
+ file_data,
388
+ dry_run,
389
+ ) ) ;
390
+ fs. push ( upload_release_artifact (
391
+ & client,
392
+ & release,
393
+ format ! ( "{}.sha256" , dest) ,
386
394
format ! ( "{}\n " , digest) . into_bytes ( ) ,
387
395
dry_run,
388
- )
389
- . await ?;
396
+ ) ) ;
397
+ }
398
+
399
+ let mut buffered = futures:: stream:: iter ( fs) . buffer_unordered ( 6 ) ;
400
+
401
+ while let Some ( res) = buffered. next ( ) . await {
402
+ res?;
390
403
}
391
404
392
405
let shasums = digests
@@ -400,7 +413,7 @@ pub async fn command_upload_release_distributions(args: &ArgMatches) -> Result<(
400
413
upload_release_artifact (
401
414
& client,
402
415
& release,
403
- "SHA256SUMS" ,
416
+ "SHA256SUMS" . to_string ( ) ,
404
417
shasums. into_bytes ( ) ,
405
418
dry_run,
406
419
)
0 commit comments