Skip to content

Commit c4cff77

Browse files
committed
Pass Rustup version to archive and manifest
1 parent 49980a3 commit c4cff77

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/rustup.rs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,15 @@ impl Context {
4444
let dist_dir = self.download_rustup_artifacts(&head_sha)?;
4545

4646
// Archive the artifacts
47-
println!("Archiving artifacts...");
48-
self.archive_rustup_artifacts(&dist_dir)?;
47+
self.archive_rustup_artifacts(&dist_dir, &version)?;
4948

5049
if self.config.channel == Channel::Stable {
5150
// Promote the artifacts to the release bucket
52-
println!("Promoting artifacts to dist/...");
5351
self.promote_rustup_artifacts(&dist_dir)?;
5452
}
5553

5654
// Update the release number
57-
println!("Updating version and manifest...");
58-
self.update_rustup_release()?;
55+
self.update_rustup_release(&version)?;
5956

6057
Ok(())
6158
}
@@ -119,18 +116,17 @@ impl Context {
119116
Ok(dl)
120117
}
121118

122-
fn archive_rustup_artifacts(&mut self, dist_dir: &Path) -> Result<(), Error> {
123-
let version = self
124-
.current_version
125-
.as_ref()
126-
.ok_or_else(|| anyhow!("failed to get current version for rustup release"))?;
119+
fn archive_rustup_artifacts(&mut self, dist_dir: &Path, version: &str) -> Result<(), Error> {
120+
println!("Archiving artifacts for version {version}...");
127121

128122
let path = format!("archive/{}/", version);
129123

130124
self.upload_rustup_artifacts(dist_dir, &path)
131125
}
132126

133127
fn promote_rustup_artifacts(&mut self, dist_dir: &Path) -> Result<(), Error> {
128+
println!("Promoting artifacts to dist/...");
129+
134130
let release_bucket_url = format!(
135131
"s3://{}/{}/{}",
136132
self.config.upload_bucket,
@@ -157,11 +153,8 @@ impl Context {
157153
.arg(&self.s3_artifacts_url(target_path)))
158154
}
159155

160-
fn update_rustup_release(&mut self) -> Result<(), Error> {
161-
let version = self
162-
.current_version
163-
.as_ref()
164-
.ok_or_else(|| anyhow!("failed to get current version for rustup release"))?;
156+
fn update_rustup_release(&mut self, version: &str) -> Result<(), Error> {
157+
println!("Updating version and manifest...");
165158

166159
let manifest_path = self.dl_dir().join("release-stable.toml");
167160
let manifest = format!(

0 commit comments

Comments
 (0)