From 935c7f461ae8b4e607f1db16322ea952b438650e Mon Sep 17 00:00:00 2001
From: Branislav Kontur <bkontur@gmail.com>
Date: Thu, 13 Jun 2024 13:53:07 +0200
Subject: [PATCH] Add `--version` to the `ChainSpecBuilder` command for
 `staging-chain-spec-builder` (#4752)

## TODO

- [x] test/confirm that the release script is ok

---------

Co-authored-by: Javier Viola <363911+pepoviola@users.noreply.github.com>
Co-authored-by: Egor_P <egor@parity.io>
---
 .../release-30_publish_release_draft.yml      | 20 ++++++++-----------
 .../bin/utils/chain-spec-builder/src/lib.rs   |  2 +-
 substrate/utils/frame/omni-bencher/Cargo.toml |  2 +-
 3 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/.github/workflows/release-30_publish_release_draft.yml b/.github/workflows/release-30_publish_release_draft.yml
index f39eb4c1716..20492f2d3a9 100644
--- a/.github/workflows/release-30_publish_release_draft.yml
+++ b/.github/workflows/release-30_publish_release_draft.yml
@@ -31,7 +31,8 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        binary: [ frame-omni-bencher, chain-spec-builder ]
+        # Tuples of [package, binary-name]
+        binary: [ [frame-omni-bencher, frame-omni-bencher], [staging-chain-spec-builder, chain-spec-builder] ]
     steps:
       - name: Checkout sources
         uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
@@ -41,21 +42,16 @@ jobs:
           sudo apt update
           sudo apt install -y protobuf-compiler
 
-      - name: Build ${{ matrix.binary }} binary
+      - name: Build ${{ matrix.binary[1] }} binary
         run: |
-          if [[ ${{ matrix.binary }} =~ chain-spec-builder ]]; then
-            cargo build --locked --profile=production -p staging-${{ matrix.binary }} --bin ${{ matrix.binary }}
-            target/production/${{ matrix.binary }} -h
-          else
-            cargo build --locked --profile=production -p ${{ matrix.binary }}
-            target/production/${{ matrix.binary }} --version
-          fi
+          cargo build --locked --profile=production -p ${{ matrix.binary[0] }} --bin ${{ matrix.binary[1] }}
+          target/production/${{ matrix.binary[1] }} --version
 
-      - name: Upload ${{ matrix.binary }} binary
+      - name: Upload ${{ matrix.binary[1] }} binary
         uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
         with:
-          name: ${{ matrix.binary }}
-          path: target/production/${{ matrix.binary }}
+          name: ${{ matrix.binary[1] }}
+          path: target/production/${{ matrix.binary[1] }}
 
 
   publish-release-draft:
diff --git a/substrate/bin/utils/chain-spec-builder/src/lib.rs b/substrate/bin/utils/chain-spec-builder/src/lib.rs
index 0f7c003fc8c..4c00bb3551b 100644
--- a/substrate/bin/utils/chain-spec-builder/src/lib.rs
+++ b/substrate/bin/utils/chain-spec-builder/src/lib.rs
@@ -125,7 +125,7 @@ use serde_json::Value;
 
 /// A utility to easily create a chain spec definition.
 #[derive(Debug, Parser)]
-#[command(rename_all = "kebab-case")]
+#[command(rename_all = "kebab-case", version, about)]
 pub struct ChainSpecBuilder {
 	#[command(subcommand)]
 	pub command: ChainSpecBuilderCmd,
diff --git a/substrate/utils/frame/omni-bencher/Cargo.toml b/substrate/utils/frame/omni-bencher/Cargo.toml
index 0c2d1a1b32b..41e3882c9d7 100644
--- a/substrate/utils/frame/omni-bencher/Cargo.toml
+++ b/substrate/utils/frame/omni-bencher/Cargo.toml
@@ -11,7 +11,7 @@ license.workspace = true
 workspace = true
 
 [dependencies]
-clap = { version = "4.5.2", features = ["derive"] }
+clap = { version = "4.5.3", features = ["derive"] }
 cumulus-primitives-proof-size-hostfunction = { path = "../../../../cumulus/primitives/proof-size-hostfunction" }
 frame-benchmarking-cli = { path = "../benchmarking-cli", default-features = false }
 sc-cli = { path = "../../../client/cli" }
-- 
GitLab