Skip to content
Snippets Groups Projects
Commit 898ccfc8 authored by Éloïs's avatar Éloïs
Browse files

upgrade srtool to 1.62

parent 99fb985b
Branches
Tags runtime-300
No related merge requests found
...@@ -42,13 +42,23 @@ struct SrtoolRuntime { ...@@ -42,13 +42,23 @@ struct SrtoolRuntime {
#[derive(Default, Deserialize)] #[derive(Default, Deserialize)]
struct SrtoolRuntimeSubWasm { struct SrtoolRuntimeSubWasm {
core_version: String, core_version: CoreVersion,
metadata_version: u32, metadata_version: u32,
size: u32, size: u32,
blake2_256: String, blake2_256: String,
proposal_hash: String, proposal_hash: String,
} }
#[derive(Default, Deserialize)]
#[serde(rename_all = "camelCase")]
struct CoreVersion {
//impl_name: String,
//impl_version: u32,
spec_name: String,
spec_version: u32,
//transaction_version: u32,
}
pub(super) async fn release_runtime(spec_version: u32) -> Result<()> { pub(super) async fn release_runtime(spec_version: u32) -> Result<()> {
// Get current dir // Get current dir
let pwd = std::env::current_dir()? let pwd = std::env::current_dir()?
...@@ -60,6 +70,14 @@ pub(super) async fn release_runtime(spec_version: u32) -> Result<()> { ...@@ -60,6 +70,14 @@ pub(super) async fn release_runtime(spec_version: u32) -> Result<()> {
// TODO: create and push a git tag runtime-{spec_version} // TODO: create and push a git tag runtime-{spec_version}
// Create target folder for runtime build
Command::new("mkdir")
.args(["-p", "runtime/gdev/target"])
.status()?;
Command::new("chmod")
.args(["777", "runtime/gdev/target"])
.status()?;
// Build the new runtime // Build the new runtime
println!("Build gdev-runtime… (take a while)"); println!("Build gdev-runtime… (take a while)");
let output = Command::new("docker") let output = Command::new("docker")
...@@ -73,7 +91,7 @@ pub(super) async fn release_runtime(spec_version: u32) -> Result<()> { ...@@ -73,7 +91,7 @@ pub(super) async fn release_runtime(spec_version: u32) -> Result<()> {
"RUNTIME_DIR=runtime/gdev", "RUNTIME_DIR=runtime/gdev",
"-v", "-v",
&format!("{}:/build", pwd), &format!("{}:/build", pwd),
"paritytech/srtool:1.60.0", "paritytech/srtool:1.62.0",
"build", "build",
"--app", "--app",
"--json", "--json",
...@@ -128,7 +146,13 @@ async fn gen_release_notes(spec_version: u32, srtool: Srtool) -> Result<String> ...@@ -128,7 +146,13 @@ async fn gen_release_notes(spec_version: u32, srtool: Srtool) -> Result<String>
format!("{} KB", wasm.size / 1_024), format!("{} KB", wasm.size / 1_024),
); );
values.insert("runtime_size".to_owned(), wasm.size.to_string()); values.insert("runtime_size".to_owned(), wasm.size.to_string());
values.insert("core_version".to_owned(), wasm.core_version); values.insert(
"core_version".to_owned(),
format!(
"{}-{}",
wasm.core_version.spec_name, wasm.core_version.spec_version
),
);
values.insert( values.insert(
"compression_percent".to_owned(), "compression_percent".to_owned(),
format!("{:.2}", compression_percent), format!("{:.2}", compression_percent),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment