Skip to content

Conversation

@DennisDyallo
Copy link
Collaborator

This pull request introduces improved versioning support for the Yubico.NativeShims library, 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:

  • The CMakeLists.txt now sets the project version dynamically via the PROJECT_VERSION variable, defaulting to 1.14.0 if not specified, and synchronizes the VCPKG manifest version accordingly. [1] [2]
  • Version information is now exposed to C/C++ code via new preprocessor macros in Yubico.NativeShims.h.in, including YUBICO_NATIVE_SHIMS_VERSION and its components.

Build pipeline and script enhancements:

  • All platform build scripts (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:

  • A new Windows resource file (Yubico.NativeShims.rc) has been added and integrated into the build to embed version and product metadata into the DLL. [1] [2]

Copy link
Contributor

Copilot AI left a 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)
Copy link

Copilot AI Sep 17, 2025

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.

Copilot uses AI. Check for mistakes.
@DennisDyallo DennisDyallo merged commit eb87aed into main Sep 17, 2025
@DennisDyallo DennisDyallo deleted the release/1.14.0 branch September 17, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants