From f5234f9af837e3448cb703d49c05cf8c773aa73f Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Tue, 14 Oct 2025 14:42:27 +0200 Subject: [PATCH] fix: Issue where binaries would not know their own versions - CARGO_PKG_VERSION used everywhere instead of VERGEN_GIT_DESCRIBE - Reject makers <3.2.0-rc.1 --- .github/workflows/draft-new-release.yml | 18 +++++++++++++++--- src-gui/src/utils/multiAddrUtils.ts | 2 +- swap-asb/src/command.rs | 2 +- swap-asb/src/main.rs | 2 +- swap/src/cli/api.rs | 2 +- swap/src/cli/command.rs | 2 +- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 157f2b27..ee6fb0b9 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -34,18 +34,30 @@ jobs: git config user.name "${{ secrets.BOTTY_NAME }}" git config user.email ${{ secrets.BOTTY_EMAIL }} - - name: Bump version in Cargo.toml + - name: Bump version in swap/Cargo.toml uses: thomaseizinger/set-crate-version@1.0.0 with: version: ${{ github.event.inputs.version }} manifest: swap/Cargo.toml - - name: Bump version in Cargo.toml for GUI + - name: Bump version in src-tauri/Cargo.toml uses: thomaseizinger/set-crate-version@1.0.0 with: version: ${{ github.event.inputs.version }} manifest: src-tauri/Cargo.toml + - name: Bump version in swap-asb/Cargo.toml + uses: thomaseizinger/set-crate-version@1.0.0 + with: + version: ${{ github.event.inputs.version }} + manifest: swap-asb/Cargo.toml + + - name: Bump version in swap-controller/Cargo.toml + uses: thomaseizinger/set-crate-version@1.0.0 + with: + version: ${{ github.event.inputs.version }} + manifest: swap-controller/Cargo.toml + - name: Update version in tauri.conf.json for GUI run: | sed -i 's/"version": "[^"]*"/"version": "${{ github.event.inputs.version }}"/' src-tauri/tauri.conf.json @@ -63,7 +75,7 @@ jobs: curl -fsSL https://dprint.dev/install.sh | sh -s $DPRINT_VERSION /home/runner/.dprint/bin/dprint fmt - git add CHANGELOG.md Cargo.lock swap/Cargo.toml src-tauri/Cargo.toml src-tauri/tauri.conf.json + git add CHANGELOG.md Cargo.lock swap/Cargo.toml src-tauri/Cargo.toml swap-asb/Cargo.toml swap-controller/Cargo.toml src-tauri/tauri.conf.json git commit --message "Prepare release ${{ github.event.inputs.version }}" echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT diff --git a/src-gui/src/utils/multiAddrUtils.ts b/src-gui/src/utils/multiAddrUtils.ts index 07f6873b..6223a260 100644 --- a/src-gui/src/utils/multiAddrUtils.ts +++ b/src-gui/src/utils/multiAddrUtils.ts @@ -6,7 +6,7 @@ import { isTestnet } from "store/config"; // const MIN_ASB_VERSION = "1.0.0-alpha.1" // First version to support new libp2p protocol // const MIN_ASB_VERSION = "1.1.0-rc.3" // First version with support for bdk > 1.0 // const MIN_ASB_VERSION = "2.0.0-beta.1"; // First version with support for tx_early_refund -const MIN_ASB_VERSION = "3.0.0"; +const MIN_ASB_VERSION = "3.2.0-rc.1"; export function providerToConcatenatedMultiAddr(provider: Maker) { return new Multiaddr(provider.multiAddr) diff --git a/swap-asb/src/command.rs b/swap-asb/src/command.rs index a535b796..31b68ddd 100644 --- a/swap-asb/src/command.rs +++ b/swap-asb/src/command.rs @@ -272,7 +272,7 @@ pub enum Command { name = "asb", about = "Automated Swap Backend for swapping XMR for BTC", author, - version = env!("VERGEN_GIT_DESCRIBE") + version = env!("CARGO_PKG_VERSION") )] pub struct RawArguments { #[structopt(long, help = "Swap on testnet")] diff --git a/swap-asb/src/main.rs b/swap-asb/src/main.rs index 274854e3..3805083d 100644 --- a/swap-asb/src/main.rs +++ b/swap-asb/src/main.rs @@ -58,7 +58,7 @@ fn initialize_tracing(json: bool, config: &Config, trace: bool) -> Result<()> { tracing::info!( binary = "asb", - version = env!("VERGEN_GIT_DESCRIBE"), + version = env!("CARGO_PKG_VERSION"), os = std::env::consts::OS, arch = std::env::consts::ARCH, "Setting up context" diff --git a/swap/src/cli/api.rs b/swap/src/cli/api.rs index 5d34f53c..7ccc8dfc 100644 --- a/swap/src/cli/api.rs +++ b/swap/src/cli/api.rs @@ -531,7 +531,7 @@ mod builder { ); tracing::info!( binary = "cli", - version = env!("VERGEN_GIT_DESCRIBE"), + version = env!("CARGO_PKG_VERSION"), os = std::env::consts::OS, arch = std::env::consts::ARCH, "Setting up context" diff --git a/swap/src/cli/command.rs b/swap/src/cli/command.rs index 2af532e2..006010e9 100644 --- a/swap/src/cli/command.rs +++ b/swap/src/cli/command.rs @@ -292,7 +292,7 @@ where name = "swap", about = "CLI for swapping BTC for XMR", author, - version = env!("VERGEN_GIT_DESCRIBE") + version = env!("CARGO_PKG_VERSION") )] struct Arguments { // global is necessary to ensure that clap can match against testnet in subcommands