@@ -387,18 +387,39 @@ upload-addr = \"{}/{}\"
387
387
drop ( fs:: remove_dir_all ( & docs) ) ;
388
388
t ! ( fs:: create_dir_all( & docs) ) ;
389
389
let target = "x86_64-unknown-linux-gnu" ;
390
+
391
+ // Unpack the regular documentation tarball.
390
392
let tarball_prefix = format ! ( "rust-docs-{}-{}" , version, target) ;
391
393
let tarball = format ! ( "{}.tar.gz" ,
392
394
self . dl_dir( ) . join( & tarball_prefix) . display( ) ) ;
393
- let tarball_dir = format ! ( "{}/rust-docs/share/doc/rust/html" ,
394
- tarball_prefix) ;
395
+ let tarball_dir = format ! ( "{}/rust-docs/share/doc/rust/html" , tarball_prefix) ;
395
396
run ( Command :: new ( "tar" )
396
397
. arg ( "xf" )
397
398
. arg ( & tarball)
398
399
. arg ( "--strip-components=6" )
399
400
. arg ( & tarball_dir)
400
401
. current_dir ( & docs) ) ;
401
402
403
+ // Construct path to rustc documentation.
404
+ let tarball_prefix = format ! ( "rustc-docs-{}-{}" , version, target) ;
405
+ let tarball = format ! ( "{}.tar.gz" ,
406
+ self . dl_dir( ) . join( & tarball_prefix) . display( ) ) ;
407
+
408
+ // Only create and unpack rustc docs if artefacts include tarball.
409
+ if Path :: new ( & tarball) . exists ( ) {
410
+ // Create the subdirectory that we will extract our nighly documentation into.
411
+ let tarball_dir = format ! ( "{}/nightly-rustc" , tarball_dir) ;
412
+ t ! ( fs:: create_dir_all( & tarball_dir) ) ;
413
+
414
+ // Unpack the rustc documentation into the new directory.
415
+ run ( Command :: new ( "tar" )
416
+ . arg ( "xf" )
417
+ . arg ( & tarball)
418
+ . arg ( "--strip-components=6" )
419
+ . arg ( & tarball_dir)
420
+ . current_dir ( & docs) ) ;
421
+ }
422
+
402
423
// Upload this to `/doc/$channel`
403
424
let bucket = self . secrets [ "dist" ] [ "upload-bucket" ] . as_str ( ) . unwrap ( ) ;
404
425
let dst = format ! ( "s3://{}/doc/{}/" , bucket, upload_dir) ;
0 commit comments