diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..62bd2c9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,36 @@ +# Language detection configuration +# Mark NSIS toolchain files as vendored to exclude from language stats + +# NSIS toolchain directories - mark as vendored +installer/NSIS/** linguist-vendored + +# Other installer-related vendored files +installer/7z.dll linguist-vendored +installer/7z.exe linguist-vendored +installer/NSIS.chm linguist-vendored + +# Documentation files +*.md linguist-documentation +*.doc linguist-documentation +*.chm linguist-documentation +*.txt linguist-documentation + +# Resource files - exclude from language stats +*.png linguist-vendored +*.bmp linguist-vendored +*.ico linguist-vendored +*.xml linguist-vendored +*.rtf linguist-vendored + +# Ensure C++ code is properly detected +src/**/*.cpp linguist-language=C++ +src/**/*.h linguist-language=C++ + +# Ensure CMake files are properly detected +*.cmake linguist-language=CMake +CMakeLists.txt linguist-language=CMake + +# Keep project's own NSIS scripts +installer/SetupScripts/nim/nim_setup.nsi linguist-language=NSIS +installer/SetupScripts/commonfunc.nsh linguist-language=NSIS +installer/SetupScripts/nim/ui_nim_setup.nsh linguist-language=NSIS diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 22bcb3e..4594ecf 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -111,9 +111,18 @@ jobs: # Get current date for versioning $date = Get-Date -Format "yyyyMMdd" $time = Get-Date -Format "HHmm" - $version = "1.0.0" $datetime = "${date}_${time}" + # Get version from git tag or use default + $gitTag = git describe --tags --exact-match HEAD 2>$null + if ($gitTag -and $gitTag -match '^v?(.+)$') { + $version = $matches[1] + Write-Host "Using version from git tag: $version" + } else { + $version = "1.0.0" + Write-Host "No git tag found, using default version: $version" + } + # Create package directory New-Item -ItemType Directory -Path "release" -Force