From 4c29e15329bfd8212d2ec475b5a0392faadd9453 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 18 Oct 2025 14:53:37 -0400 Subject: [PATCH] v0.7.27 - Update increment and push script --- increment_and_push.sh | 33 +++++++++++++++++++++++++++++++++ src/main.h | 6 +++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/increment_and_push.sh b/increment_and_push.sh index 7f21286..539dbac 100755 --- a/increment_and_push.sh +++ b/increment_and_push.sh @@ -121,10 +121,43 @@ increment_version() { print_status "Current version: $LATEST_TAG" print_status "New version: $NEW_VERSION" + # Update version in src/main.h + update_version_in_header "$NEW_VERSION" "$MAJOR" "$NEW_MINOR" "$NEW_PATCH" + # Export for use in other functions export NEW_VERSION } +# Function to update version macros in src/main.h +update_version_in_header() { + local new_version="$1" + local major="$2" + local minor="$3" + local patch="$4" + + print_status "Updating version in src/main.h..." + + # Check if src/main.h exists + if [[ ! -f "src/main.h" ]]; then + print_error "src/main.h not found" + exit 1 + fi + + # Update VERSION macro + sed -i "s/#define VERSION \".*\"/#define VERSION \"$new_version\"/" src/main.h + + # Update VERSION_MAJOR macro + sed -i "s/#define VERSION_MAJOR [0-9]\+/#define VERSION_MAJOR $major/" src/main.h + + # Update VERSION_MINOR macro + sed -i "s/#define VERSION_MINOR [0-9]\+/#define VERSION_MINOR $minor/" src/main.h + + # Update VERSION_PATCH macro + sed -i "s/#define VERSION_PATCH [0-9]\+/#define VERSION_PATCH $patch/" src/main.h + + print_success "Updated version in src/main.h to $new_version" +} + # Function to commit and push changes git_commit_and_push() { print_status "Preparing git commit..." diff --git a/src/main.h b/src/main.h index 99d7c24..a5e0c61 100644 --- a/src/main.h +++ b/src/main.h @@ -10,10 +10,10 @@ #define MAIN_H // Version information (auto-updated by build system) -#define VERSION "v0.4.6" +#define VERSION "v0.7.27" #define VERSION_MAJOR 0 -#define VERSION_MINOR 4 -#define VERSION_PATCH 6 +#define VERSION_MINOR +#define VERSION_PATCH 27 // Relay metadata (authoritative source for NIP-11 information) #define RELAY_NAME "C-Relay"