-
Notifications
You must be signed in to change notification settings - Fork 60
build: improved versioning support for the Yubico.NativeShims library #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
docs: release notes for 1.14
Set version in vcpkg and CMakeLists.txt on Github Actions build Robustness in creating directories for macOs and Windows
…ate project versioning
refactor(build): streamline version handling in build scripts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces comprehensive versioning support for the Yubico.NativeShims library, enabling dynamic version injection during builds and adding native metadata support across all platforms.
- Adds dynamic version configuration via CMake with PROJECT_VERSION parameter and default fallback
- Updates all platform build scripts to accept and propagate version parameters through the build pipeline
- Introduces Windows-specific version metadata through resource files and preprocessor macros
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vcpkg.json | Removes hardcoded version to enable dynamic versioning |
| CMakeLists.txt | Adds version parameter handling, VCPKG manifest sync, and Windows resource integration |
| Yubico.NativeShims.h.in | Defines version preprocessor macros for C/C++ code |
| Yubico.NativeShims.rc | New Windows resource file for native DLL version metadata |
| build-*.sh/ps1 | Updates all platform build scripts to accept version parameters |
| build-nativeshims.yml | Modifies GitHub Actions workflow to parse and pass version to build scripts |
| cd Yubico.NativeShims | ||
| sh ./build-linux-amd64.sh | ||
| if [ ! -z "${{ github.event.inputs.version }}" ]; then | ||
| BASE_VERSION=$(echo "${{ github.event.inputs.version }}" | cut -d'-' -f1) |
Copilot
AI
Sep 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The bash version parsing using cut -d'-' -f1 will return the entire string if no hyphen exists, but this inconsistency with the PowerShell approach could lead to confusion. Consider standardizing the version parsing logic across all platforms.
Co-authored-by: Copilot <[email protected]>
This pull request introduces improved versioning support for the
Yubico.NativeShimslibrary, enabling dynamic version injection during builds across all supported platforms (Windows, Linux, macOS). It also adds a Windows resource file for native version metadata and exposes version information as preprocessor macros for use in C/C++ code. The build scripts and workflow have been updated to accept and propagate a version parameter.Versioning improvements:
CMakeLists.txtnow sets the project version dynamically via thePROJECT_VERSIONvariable, defaulting to1.14.0if not specified, and synchronizes the VCPKG manifest version accordingly. [1] [2]Yubico.NativeShims.h.in, includingYUBICO_NATIVE_SHIMS_VERSIONand its components.Build pipeline and script enhancements:
build-windows.ps1,build-linux-amd64.sh,build-linux-arm64.sh,build-macOS.sh) and the GitHub Actions workflow (build-nativeshims.yml) have been updated to accept an optional version parameter, passing it through to CMake to control the build version. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Windows-specific enhancements:
Yubico.NativeShims.rc) has been added and integrated into the build to embed version and product metadata into the DLL. [1] [2]