This document describes the automated version management scripts used in the Log Viewer project to maintain consistency across all platforms and build artifacts.
The Log Viewer project uses centralized version management through the Build_Version
file, with automated scripts that update platform-specific files to maintain version consistency.
Location: rpmbuild/SOURCES/Build_Version
VERSION=3.2.0
This file serves as the single source of truth for the application version across all platforms.
Purpose: Updates RPM spec files with the current version
Location: rpmbuild/SOURCES/update_rpm_version.sh
What it updates:
../SPECS/LogViewer.spec
- Updates the %define version
lineUsage:
cd rpmbuild/SOURCES
./update_rpm_version.sh
Cross-platform compatibility: Handles both macOS and Linux sed
syntax differences.
Purpose: Updates Windows Inno Setup installer script with version and executable references
Location: rpmbuild/SOURCES/update_inno_version.py
What it updates:
#define MyAppVersion "X.X.X"
- Main version definition#define MyAppExeName "LogViewer-X.X.X.exe"
- Executable name definitionSource: "LogViewer-X.X.X.exe"
- Source file reference in [Files] sectionEnhanced Features:
LogViewer.*\.exe
to match any versioned executableUsage:
cd rpmbuild/SOURCES
python3 update_inno_version.py
Example Output:
Updating Inno Setup script for version: 3.2.0
Updated LogViewer_Installer.iss with version 3.2.0 and executable name LogViewer-3.2.0.exe
Inno Setup script updated successfully
Purpose: Generates Windows version information file for executable metadata
Location: rpmbuild/SOURCES/generate_version_info.py
What it creates:
version_info.txt
- Windows version resource file for PyInstallerVersion Parsing:
X.Y.Z
or X.Y.Z.B
3.0.0.0
if parsing failsUsage:
cd rpmbuild/SOURCES
python3 generate_version_info.py
The version scripts are automatically called during platform builds:
Build_Version
in PyInstaller spec filesBuild_Version
file bundled with app bundle via datas arrayBuild_Version
in PyInstaller spec fileBuild_Version
file bundled with executable via datas arrayupdate_rpm_version.sh
Local Builds (Build_App_Windows.bat
):
REM Read version from Build_Version file
for /f "tokens=2 delims==" %%a in ('findstr "VERSION=" Build_Version 2^>nul') do set VERSION=%%a
REM Update version-dependent files
python generate_version_info.py
python update_inno_version.py
REM Build with versioned output
pyinstaller log_viewer_windows.spec
GitHub Actions Workflow (.github/workflows/windows_build.yml
):
Fixed in v3.2.0 - The workflow now calls version scripts in the correct order:
# Generate version info
python generate_version_info.py
# Update Inno Setup script BEFORE building
python update_inno_version.py
# Build executable
pyinstaller --noconfirm log_viewer_windows.spec
Previous Issue: The workflow was calling update_inno_version.py
after PyInstaller, causing Inno Setup to reference non-existent versioned executables.
Build_App.sh
)# Read version and update RPM spec
./update_rpm_version.sh
# Build executable (includes Build_Version in bundle)
pyinstaller --noconfirm ./log_viewer.spec
Recent Fix (v3.2.0): Updated log_viewer.spec
to include Build_Version
in the datas
array:
datas=[('config.yml', '.'), ('help_content.md', '.'), ('Build_Version', '.'), ...]
This ensures the Linux executable can read the version dynamically for the About dialog, fixing the issue where Linux builds were stuck at version 3.0.0.
Recent Fixes (v3.3.0):
update_inno_version.py
was called after PyInstaller in the GitHub Actions workflow, causing Inno Setup to reference non-existent versioned executables. The workflow now correctly calls version scripts before building.update_inno_version.py
to handle both versioned and unversioned executables by changing the regex pattern from LogViewer\.exe
to LogViewer.*\.exe
, ensuring automatic version updates work regardless of previous state.automated_comprehensive_release.yml
that was causing workflow validation failures.tmichett@redhat.com
to travis@michettetech.com
across the entire codebase.To verify all components are using the correct version:
cd rpmbuild/SOURCES
# Check central version
grep "VERSION=" Build_Version
# Check RPM spec
grep "%define version" ../SPECS/LogViewer.spec
# Check Windows installer script
grep -E "(MyAppVersion|MyAppExeName|Source.*LogViewer.*\.exe)" LogViewer_Installer.iss
# Check Windows version info
grep "FileVersion.*VERSION" version_info.txt
If you encounter version mismatch errors:
cat rpmbuild/SOURCES/Build_Version
cd rpmbuild/SOURCES
./update_rpm_version.sh
python3 update_inno_version.py
python3 generate_version_info.py
# Verify RPM spec
grep "%define version" ../SPECS/LogViewer.spec
# Verify Inno Setup script
grep "MyAppVersion\|Source.*LogViewer" LogViewer_Installer.iss
git add ../SPECS/LogViewer.spec LogViewer_Installer.iss version_info.txt
git commit -m "Update version references to $(grep VERSION= Build_Version | cut -d= -f2)"
Cause: Version mismatch between PyInstaller output and Inno Setup script expectations
Solution:
python3 update_inno_version.py
to sync versionsBuild_Version
contains the correct versionCause: RPM spec file not updated with new version
Solution:
./update_rpm_version.sh
manuallysed
command compatibility (macOS vs Linux)Cause: version_info.txt
not regenerated with new version
Solution:
python3 generate_version_info.py
Build_Version
format is correct (X.Y.Z
)MAJOR.MINOR.PATCH
format for consistencyWhen adding support for new platforms:
Organization: Michette Technologies
Project: Log Viewer
Last Updated: 2024