From 39b2f61cfd4a67af171278fce623d860384bbc4d Mon Sep 17 00:00:00 2001 From: Jamil Date: Tue, 28 Oct 2025 19:10:50 -0700 Subject: [PATCH] fix(ci): ensure version markers are replaced across all files (#10752) Upon moving the version string from PKG_VERSION and Cargo.toml, we lost the bump version automation. To avoid more bugs here in the future, we now check for the version marker across all Git-tracked files, regardless of their extension. Fixes #10748 --------- Co-authored-by: Thomas Eizinger --- rust/client-ffi/src/platform/android.rs | 4 +- rust/client-ffi/src/platform/apple.rs | 4 +- scripts/bump-versions.sh | 52 ++++++++++--------- .../apple/Firezone.xcodeproj/project.pbxproj | 12 ++--- swift/apple/Firezone/xcconfig/config.xcconfig | 3 ++ website/src/components/Changelog/Android.tsx | 6 ++- website/src/components/Changelog/Apple.tsx | 6 ++- 7 files changed, 50 insertions(+), 37 deletions(-) diff --git a/rust/client-ffi/src/platform/android.rs b/rust/client-ffi/src/platform/android.rs index 9db99d898..b0fefdeec 100644 --- a/rust/client-ffi/src/platform/android.rs +++ b/rust/client-ffi/src/platform/android.rs @@ -5,9 +5,9 @@ mod make_writer; mod tun; // mark:next-android-version -pub const RELEASE: &str = "connlib-android@1.5.2"; +pub const RELEASE: &str = "connlib-android@1.5.7"; // mark:next-android-version -pub const VERSION: &str = "1.5.2"; +pub const VERSION: &str = "1.5.7"; pub const COMPONENT: &str = "android-client"; /// We have valid use cases for headless Android clients diff --git a/rust/client-ffi/src/platform/apple.rs b/rust/client-ffi/src/platform/apple.rs index 7c5671caf..faf5f65ba 100644 --- a/rust/client-ffi/src/platform/apple.rs +++ b/rust/client-ffi/src/platform/apple.rs @@ -5,10 +5,10 @@ mod make_writer; mod tun; // mark:next-apple-version -pub const RELEASE: &str = "connlib-apple@1.5.8"; +pub const RELEASE: &str = "connlib-apple@1.5.10"; // mark:next-apple-version -pub const VERSION: &str = "1.5.8"; +pub const VERSION: &str = "1.5.10"; pub const COMPONENT: &str = "apple-client"; diff --git a/scripts/bump-versions.sh b/scripts/bump-versions.sh index f00c87216..3e69452f1 100755 --- a/scripts/bump-versions.sh +++ b/scripts/bump-versions.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -xeuo pipefail -# This is script is used to bump the versions in support of our release process. +# This script is used to bump the versions in support of our release process. # See discussion here: https://github.com/firezone/firezone/issues/2041 # and PR changing it here: https://github.com/firezone/firezone/pull/2949 @@ -43,6 +43,16 @@ function update_changelog() { " "$changelog_file" } +function update_version_marker() { + local marker="$1" + local new_version="$2" + + # Use git grep to find files containing the marker (much faster and git-aware) + git grep -l "$marker" 2>/dev/null | while IFS= read -r file; do + sed "${SEDARG[@]}" -e "/${marker}/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/${new_version}/;}" "$file" + done +} + function update_version_variables() { local COMPONENT="$1" local NEW_VERSION="$2" @@ -94,11 +104,9 @@ function apple() { next_apple_client_version="1.5.10" update_changelog "website/src/components/Changelog/Apple.tsx" "$current_apple_client_version" - find website -type f -name "redirects.js" -exec sed "${SEDARG[@]}" -e '/mark:current-apple-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${current_apple_client_version}"'/g;}' {} \; - find website -type f -name "route.ts" -exec sed "${SEDARG[@]}" -e '/mark:current-apple-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${current_apple_client_version}"'/g;}' {} \; - find .github -type f -exec sed "${SEDARG[@]}" -e '/mark:next-apple-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${next_apple_client_version}"'/g;}' {} \; - find swift -type f -name "project.pbxproj" -exec sed "${SEDARG[@]}" -e "s/MARKETING_VERSION = .*;/MARKETING_VERSION = ${next_apple_client_version};/" {} \; - find rust -path rust/gui-client/node_modules -prune -o -path rust/target -prune -o -name "Cargo.toml" -exec sed "${SEDARG[@]}" -e '/mark:next-apple-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${next_apple_client_version}"'/;}' {} \; + update_version_marker "mark:current-apple-version" "$current_apple_client_version" + update_version_marker "mark:next-apple-version" "$next_apple_client_version" + cargo_update_workspace } @@ -113,7 +121,7 @@ function apple() { # As such, the process for releasing Android is similar to Apple. # # Instructions: -# 1. Run the `Kotlin` workflow from `main`. This will push an AAB to Firebase. +# 1. Run the `Kotlin` workflow from `main`. This will push an AAB to Firebase # and upload a new APK to the drafted release. # 2. Sign in to Firebase and download the build AAB, optionally distributing it # for release testing to perform any final QA tests. @@ -130,11 +138,9 @@ function android() { next_android_client_version="1.5.7" update_changelog "website/src/components/Changelog/Android.tsx" "$current_android_client_version" - find website -type f -name "redirects.js" -exec sed "${SEDARG[@]}" -e '/mark:current-android-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${current_android_client_version}"'/g;}' {} \; - find website -type f -name "route.ts" -exec sed "${SEDARG[@]}" -e '/mark:current-android-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${current_android_client_version}"'/g;}' {} \; - find .github -type f -exec sed "${SEDARG[@]}" -e '/mark:next-android-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${next_android_client_version}"'/g;}' {} \; - find kotlin -type f -name "*.gradle.kts" -exec sed "${SEDARG[@]}" -e '/mark:next-android-version/{n;s/versionName =.*/versionName = "'"${next_android_client_version}"'"/;}' {} \; - find rust -path rust/gui-client/node_modules -prune -o -path rust/target -prune -o -name "Cargo.toml" -exec sed "${SEDARG[@]}" -e '/mark:next-android-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${next_android_client_version}"'/;}' {} \; + update_version_marker "mark:current-android-version" "$current_android_client_version" + update_version_marker "mark:next-android-version" "$next_android_client_version" + cargo_update_workspace } @@ -155,11 +161,9 @@ function gui() { next_gui_client_version="1.5.9" update_changelog "website/src/components/Changelog/GUI.tsx" "$current_gui_client_version" - find website -type f -name "redirects.js" -exec sed "${SEDARG[@]}" -e '/mark:current-gui-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${current_gui_client_version}"'/g;}' {} \; - find website -type f -name "route.ts" -exec sed "${SEDARG[@]}" -e '/mark:current-gui-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${current_gui_client_version}"'/g;}' {} \; - find .github -type f -exec sed "${SEDARG[@]}" -e '/mark:next-gui-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${next_gui_client_version}"'/g;}' {} \; - find rust -path rust/gui-client/node_modules -prune -o -path rust/target -prune -o -name "Cargo.toml" -exec sed "${SEDARG[@]}" -e '/mark:next-gui-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${next_gui_client_version}"'/;}' {} \; - find rust -path rust/gui-client/node_modules -prune -o -path rust/target -prune -o -name "vite.config.ts" -exec sed "${SEDARG[@]}" -e '/mark:next-gui-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${next_gui_client_version}"'/;}' {} \; + update_version_marker "mark:current-gui-version" "$current_gui_client_version" + update_version_marker "mark:next-gui-version" "$next_gui_client_version" + cargo_update_workspace } @@ -179,10 +183,9 @@ function headless() { next_headless_client_version="1.5.5" update_changelog "website/src/components/Changelog/Headless.tsx" "$current_headless_client_version" - find website -type f -name "redirects.js" -exec sed "${SEDARG[@]}" -e '/mark:current-headless-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${current_headless_client_version}"'/g;}' {} \; - find website -type f -name "route.ts" -exec sed "${SEDARG[@]}" -e '/mark:current-headless-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${current_headless_client_version}"'/g;}' {} \; - find .github -name "*.yml" -exec sed "${SEDARG[@]}" -e '/mark:next-headless-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${next_headless_client_version}"'/g;}' {} \; - find rust -path rust/gui-client/node_modules -prune -o -path rust/target -prune -o -name "Cargo.toml" -exec sed "${SEDARG[@]}" -e '/mark:next-headless-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${next_headless_client_version}"'/;}' {} \; + update_version_marker "mark:current-headless-version" "$current_headless_client_version" + update_version_marker "mark:next-headless-version" "$next_headless_client_version" + cargo_update_workspace } @@ -202,10 +205,9 @@ function gateway() { next_gateway_version="1.4.18" update_changelog "website/src/components/Changelog/Gateway.tsx" "$current_gateway_version" - find website -type f -name "redirects.js" -exec sed "${SEDARG[@]}" -e '/mark:current-gateway-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${current_gateway_version}"'/g;}' {} \; - find website -type f -name "route.ts" -exec sed "${SEDARG[@]}" -e '/mark:current-gateway-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${current_gateway_version}"'/g;}' {} \; - find .github -type f -exec sed "${SEDARG[@]}" -e '/mark:next-gateway-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${next_gateway_version}"'/g;}' {} \; - find rust -path rust/gui-client/node_modules -prune -o -path rust/target -prune -o -name "Cargo.toml" -exec sed "${SEDARG[@]}" -e '/mark:next-gateway-version/{n;s/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"${next_gateway_version}"'/;}' {} \; + update_version_marker "mark:current-gateway-version" "$current_gateway_version" + update_version_marker "mark:next-gateway-version" "$next_gateway_version" + cargo_update_workspace } diff --git a/swift/apple/Firezone.xcodeproj/project.pbxproj b/swift/apple/Firezone.xcodeproj/project.pbxproj index 52c04e723..e632b80ee 100644 --- a/swift/apple/Firezone.xcodeproj/project.pbxproj +++ b/swift/apple/Firezone.xcodeproj/project.pbxproj @@ -581,7 +581,7 @@ ); "LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(CONNLIB_TARGET_DIR)/aarch64-apple-ios/debug"; MACOSX_DEPLOYMENT_TARGET = 12.4; - MARKETING_VERSION = 1.5.10; + MARKETING_VERSION = "$(inherited)"; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-lconnlib"; OTHER_SWIFT_FLAGS = "-D UNIFFI"; @@ -625,7 +625,7 @@ ); "LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(CONNLIB_TARGET_DIR)/aarch64-apple-ios/release"; MACOSX_DEPLOYMENT_TARGET = 12.4; - MARKETING_VERSION = 1.5.10; + MARKETING_VERSION = "$(inherited)"; OTHER_LDFLAGS = "-lconnlib"; OTHER_SWIFT_FLAGS = "-D UNIFFI"; PRODUCT_BUNDLE_IDENTIFIER = "$(inherited).network-extension"; @@ -668,7 +668,7 @@ "LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(CONNLIB_TARGET_DIR)/aarch64-apple-darwin/debug"; "LIBRARY_SEARCH_PATHS[arch=arm64e]" = "$(CONNLIB_TARGET_DIR)/aarch64-apple-darwin/debug"; "LIBRARY_SEARCH_PATHS[arch=x86_64]" = "$(CONNLIB_TARGET_DIR)/x86_64-apple-darwin/debug"; - MARKETING_VERSION = 1.5.10; + MARKETING_VERSION = "$(inherited)"; OTHER_LDFLAGS = "-lconnlib"; OTHER_SWIFT_FLAGS = "-D UNIFFI"; PRODUCT_BUNDLE_IDENTIFIER = "$(inherited).network-extension"; @@ -710,7 +710,7 @@ "LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(CONNLIB_TARGET_DIR)/aarch64-apple-darwin/release"; "LIBRARY_SEARCH_PATHS[arch=arm64e]" = "$(CONNLIB_TARGET_DIR)/aarch64-apple-darwin/release"; "LIBRARY_SEARCH_PATHS[arch=x86_64]" = "$(CONNLIB_TARGET_DIR)/x86_64-apple-darwin/release"; - MARKETING_VERSION = 1.5.10; + MARKETING_VERSION = "$(inherited)"; OTHER_LDFLAGS = "-lconnlib"; OTHER_SWIFT_FLAGS = "-D UNIFFI"; PRODUCT_BUNDLE_IDENTIFIER = "$(inherited).network-extension"; @@ -887,7 +887,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 12.4; - MARKETING_VERSION = 1.5.10; + MARKETING_VERSION = "$(inherited)"; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "$(inherited)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -937,7 +937,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 12.4; - MARKETING_VERSION = 1.5.10; + MARKETING_VERSION = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = "$(inherited)"; PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/swift/apple/Firezone/xcconfig/config.xcconfig b/swift/apple/Firezone/xcconfig/config.xcconfig index 4669129d5..c33141425 100644 --- a/swift/apple/Firezone/xcconfig/config.xcconfig +++ b/swift/apple/Firezone/xcconfig/config.xcconfig @@ -9,3 +9,6 @@ CODE_SIGN_STYLE = Automatic // Include the dynamic build number created during the build phase #include? "dynamic_build_number.xcconfig" + +// mark:next-apple-version +MARKETING_VERSION=1.5.10 diff --git a/website/src/components/Changelog/Android.tsx b/website/src/components/Changelog/Android.tsx index 33f3d842f..ed50b756d 100644 --- a/website/src/components/Changelog/Android.tsx +++ b/website/src/components/Changelog/Android.tsx @@ -20,7 +20,11 @@ export default function Android() { return ( {/* When you cut a release, remove any solved issues from the "known issues" lists over in `client-apps`. This must not be done when the issue's PR merges. */} - + + + Fixes an issue where the reported client version was out of date. + + Fixes an issue where the Tunnel service would crash when trying to diff --git a/website/src/components/Changelog/Apple.tsx b/website/src/components/Changelog/Apple.tsx index 21388e7a6..4beec89bf 100644 --- a/website/src/components/Changelog/Apple.tsx +++ b/website/src/components/Changelog/Apple.tsx @@ -24,7 +24,11 @@ export default function Apple() { return ( {/* When you cut a release, remove any solved issues from the "known issues" lists over in `client-apps`. This must not be done when the issue's PR merges. */} - + + + Fixes an issue where the reported client version was out of date. + + Fixes an issue on macOS where DNS resources might fail to be routed