Skip to content
This repository was archived by the owner on Nov 26, 2020. It is now read-only.

Commit 64230e0

Browse files
authored
Merge pull request #40 from davidtwco/rust-lang/rust-issue-29893
Host compiler documentation
2 parents c9079ba + 2538d80 commit 64230e0

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

promote-release/src/main.rs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,18 +387,39 @@ upload-addr = \"{}/{}\"
387387
drop(fs::remove_dir_all(&docs));
388388
t!(fs::create_dir_all(&docs));
389389
let target = "x86_64-unknown-linux-gnu";
390+
391+
// Unpack the regular documentation tarball.
390392
let tarball_prefix = format!("rust-docs-{}-{}", version, target);
391393
let tarball = format!("{}.tar.gz",
392394
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);
395396
run(Command::new("tar")
396397
.arg("xf")
397398
.arg(&tarball)
398399
.arg("--strip-components=6")
399400
.arg(&tarball_dir)
400401
.current_dir(&docs));
401402

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+
402423
// Upload this to `/doc/$channel`
403424
let bucket = self.secrets["dist"]["upload-bucket"].as_str().unwrap();
404425
let dst = format!("s3://{}/doc/{}/", bucket, upload_dir);

0 commit comments

Comments
 (0)