Skip to content

Commit

Permalink
Release v0.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav committed Dec 25, 2024
1 parent 48b2b9f commit 45a06e7
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2021"
homepage = "https://hack.ink/polkadot-runtime-releaser"
license = "GPL-3.0"
repository = "https://github.com/hack-ink/polkadot-runtime-releaser"
version = "0.1.7"
version = "0.1.8"

[workspace.dependencies]
# crates.io
Expand Down
8 changes: 7 additions & 1 deletion action/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
runtime:
description: "Target runtime to build."
required: true
override-runtime-name:
description: "The name to use matching the runtime artifacts."
required: false
features:
description: "Features to enable for the runtime."
required: false
Expand All @@ -27,7 +30,7 @@ runs:
- name: Setup Polkadot Runtime Releaser
shell: bash
run: curl
-L https://github.com/hack-ink/polkadot-runtime-releaser/releases/download/v0.1.7/prr-x86_64-unknown-linux-gnu.tar.gz |
-L https://github.com/hack-ink/polkadot-runtime-releaser/releases/download/v0.1.8/prr-x86_64-unknown-linux-gnu.tar.gz |
tar xz &&
chmod u+x prr &&
mv prr /usr/local/bin/prr
Expand All @@ -36,6 +39,9 @@ runs:
run: |
CMD="prr build ${{ inputs.runtime }}"
if [ ! -z "${{ inputs.override-runtime-name }}" ]; then
CMD="$CMD -n ${{ inputs.override-runtime-name }}"
fi
if [ ! -z "${{ inputs.features }}" ]; then
CMD="$CMD -f ${{ inputs.features }}"
fi
Expand Down
2 changes: 1 addition & 1 deletion action/inspect/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
- name: Setup Polkadot Runtime Releaser
shell: bash
run: curl
-L https://github.com/hack-ink/polkadot-runtime-releaser/releases/download/v0.1.7/prr-x86_64-unknown-linux-gnu.tar.gz |
-L https://github.com/hack-ink/polkadot-runtime-releaser/releases/download/v0.1.8/prr-x86_64-unknown-linux-gnu.tar.gz |
tar xz &&
chmod u+x prr &&
mv prr /usr/local/bin/prr
Expand Down
6 changes: 5 additions & 1 deletion action/override/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ inputs:
runtime:
description: "Target runtime to build."
required: true
override-runtime-name:
description: "The name to use matching the runtime artifacts."
required: false
features:
description: "Features to enable for the runtime."
required: true
Expand All @@ -40,9 +43,10 @@ runs:
ref: ${{ inputs.ref }}
path: runtime
- name: Build runtime
uses: hack-ink/polkadot-runtime-releaser/action/build@main
uses: hack-ink/polkadot-runtime-releaser/action/build@0.1.8
with:
runtime: ${{ inputs.runtime }}
override-runtime-name: ${{ inputs.override-runtime-name }}
features: ${{ inputs.features }}
toolchain-ver: ${{ inputs.toolchain-ver }}
workdir: runtime
Expand Down
2 changes: 1 addition & 1 deletion action/try-runtime/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
chmod +x try-runtime &&
mv try-runtime /usr/local/bin/try-runtime
- name: Build runtime
uses: hack-ink/polkadot-runtime-releaser/action/build@main
uses: hack-ink/polkadot-runtime-releaser/action/build@0.1.8
with:
runtime: ${{ inputs.runtime }}
features: ${{ inputs.features }}
Expand Down
46 changes: 35 additions & 11 deletions cli/src/cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,43 @@ const WASM_EXT_COMPRESSED: &str = "compact.compressed.wasm";

#[derive(Debug, Parser)]
pub struct BuildCmd {
/// The target runtime crate to build.
/// The target runtime to build.
///
/// This should be the name of the runtime crate in the <Cargo.toml> file.
#[arg(value_name = "RUNTIME")]
#[arg(value_name = "RUNTIME", verbatim_doc_comment)]
runtime: String,
/// The features to enable for the runtime crate.
#[arg(long, short, value_name = "FEATURES")]
/// The name to use matching the runtime artifacts.
/// This is useful when the runtime crate name is different from the runtime name.
///
/// For example, `staging-kusama-runtime`.
/// With this option, you can specify the runtime name to be `kusama`,
/// and it will match the `kusama_runtime*.wasm` artifacts.
#[arg(long, short = 'n', value_name = "NAME", verbatim_doc_comment)]
override_runtime_name: Option<String>,
/// The features to enable for the runtime.
#[arg(long, short, value_name = "FEATURES", verbatim_doc_comment)]
features: Option<String>,
/// Whether to store the compressed runtime only.
#[arg(long)]
#[arg(long, verbatim_doc_comment)]
no_compressed_only: bool,
/// The toolchain version to use for the build; by default, it is set to <stable>.
///
/// This won't take effect if there is a <rust-toolchain.toml> file in the project directory,
/// and that's the recommended way to specify the toolchain version.
#[arg(long, short, value_name = "VER", verbatim_doc_comment)]
toolchain_version: Option<String>,
/// Image version of the <ghcr.io/hack-ink/polkadot-runtime-releaser>.
#[arg(long, short = 'v', value_name = "VER", default_value_t = String::from("0.1.7"), conflicts_with = "override_docker_image")]
#[arg(
long,
short = 'v',
value_name = "VER",
default_value_t = String::from("0.1.8"),
verbatim_doc_comment,
conflicts_with = "override_docker_image"
)]
image_version: String,
/// Overwrite the default docker image with the specified one.
///
/// Use `docker images` to list the available images on your system.
#[arg(
long,
Expand All @@ -41,30 +59,32 @@ pub struct BuildCmd {
)]
override_docker_image: Option<String>,
/// The polkadot-sdk-based project directory; by default, it is set to the current directory.
#[arg(long, short = 'd', value_name = "PATH")]
#[arg(long, short = 'd', value_name = "PATH", verbatim_doc_comment)]
workdir: Option<PathBuf>,
/// The target directory of the cargo build.
#[arg(
long,
short = 'o',
value_name = "PATH",
default_value = "./polkadot-runtime-releaser-output"
default_value = "./polkadot-runtime-releaser-output",
verbatim_doc_comment
)]
output_dir: PathBuf,
/// Whether to cache and use the output of the build.
/// This is useful in local development.
#[arg(long)]
#[arg(long, verbatim_doc_comment)]
cache_output: bool,
/// Whether to cache and use the <$HOME/.cargo/registry> registry.
/// This is useful in local development.
#[arg(long)]
#[arg(long, verbatim_doc_comment)]
cache_registry: bool,
}
impl Run for BuildCmd {
// ? Remove the created files to keep clean, e.g., `rust-toolchain.toml`.
fn run(self) -> Result<()> {
let Self {
runtime,
override_runtime_name,
features,
no_compressed_only,
toolchain_version,
Expand Down Expand Up @@ -125,7 +145,11 @@ impl Run for BuildCmd {
run_args.with_command(&cmd);
run_args.run()?;

let snake_case_rt = runtime.replace("-runtime", "_runtime");
let snake_case_rt = if let Some(name) = override_runtime_name {
format!("{name}_runtime")
} else {
runtime.replace("-runtime", "_runtime")
};
let output_rt =
output_target_dir.join("release/wbuild").join(&runtime).join(&snake_case_rt);
let compressed_wasm = output_rt.with_extension(WASM_EXT_COMPRESSED);
Expand Down
6 changes: 3 additions & 3 deletions cli/src/cli/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ use prr_lib::{hasher, runtime::Version, wasmer::Wasmer};
#[derive(Debug, Parser)]
pub struct InspectCmd {
/// Path to the WASM runtime.
#[arg(value_name = "PATH")]
#[arg(value_name = "PATH", verbatim_doc_comment)]
path: PathBuf,
/// Whether to check the runtime version in the `ParachainSystem::authorized_upgrade` call.
#[arg(long, default_value_t = true)]
#[arg(long, default_value_t = true, verbatim_doc_comment)]
check_version: bool,
/// Whether to print verbose output.
#[arg(short, long)]
#[arg(short, long, verbatim_doc_comment)]
verbose: bool,
}
impl Run for InspectCmd {
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:25.04

LABEL maintainer="[email protected]"
LABEL description="An environment for constructing a deterministic polkadot-sdk-based runtime."
LABEL version="0.1.7"
LABEL version="0.1.8"

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
Expand Down

0 comments on commit 45a06e7

Please sign in to comment.