Skip to content

Commit

Permalink
Auto merge of #12292 - jonas-schievink:bump-extension-version, r=jona…
Browse files Browse the repository at this point in the history
…s-schievink

internal: Bump extension version
  • Loading branch information
bors committed May 17, 2022
2 parents c5c442e + 21b6ce8 commit 7e95c14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Rust language support for Visual Studio Code",
"private": true,
"icon": "icon.png",
"version": "0.4.0-dev",
"version": "0.5.0-dev",
"releaseTag": null,
"publisher": "rust-lang",
"repository": {
Expand Down
13 changes: 10 additions & 3 deletions xtask/src/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ use xshell::{cmd, Shell};

use crate::{date_iso, flags, project_root};

const VERSION_STABLE: &str = "0.3";
const VERSION_NIGHTLY: &str = "0.4";
const VERSION_DEV: &str = "0.5"; // keep this one in sync with `package.json`

impl flags::Dist {
pub(crate) fn run(self, sh: &Shell) -> anyhow::Result<()> {
let stable = sh.var("GITHUB_REF").unwrap_or_default().as_str() == "refs/heads/release";
Expand All @@ -25,10 +29,10 @@ impl flags::Dist {

if let Some(patch_version) = self.client_patch_version {
let version = if stable {
format!("0.2.{}", patch_version)
format!("{}.{}", VERSION_STABLE, patch_version)
} else {
// A hack to make VS Code prefer nightly over stable.
format!("0.3.{}", patch_version)
format!("{}.{}", VERSION_NIGHTLY, patch_version)
};
let release_tag = if stable { date_iso(sh)? } else { "nightly".to_string() };
dist_client(sh, &version, &release_tag, &target)?;
Expand All @@ -54,7 +58,10 @@ fn dist_client(

let mut patch = Patch::new(sh, "./package.json")?;
patch
.replace(r#""version": "0.4.0-dev""#, &format!(r#""version": "{}""#, version))
.replace(
&format!(r#""version": "{}.0-dev""#, VERSION_DEV),
&format!(r#""version": "{}""#, version),
)
.replace(r#""releaseTag": null"#, &format!(r#""releaseTag": "{}""#, release_tag))
.replace(r#""$generated-start": {},"#, "")
.replace(",\n \"$generated-end\": {}", "")
Expand Down

0 comments on commit 7e95c14

Please sign in to comment.