Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/hsm-collector-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: hsm-collector vcpkg registry

# Validates that this repository works as a vcpkg registry for `hsm-collector`:
# 1. the version database (versions/) is internally consistent with the ports (ports/), and
# 2. the registry port installs (fetching the tagged source) and a consumer links against it.
# Windows-only: the aggregator target is Windows/MSVC, and the version-DB check is platform-agnostic.

on:
push:
paths:
- 'ports/hsm-collector/**'
- 'versions/**'
- '.github/workflows/hsm-collector-registry.yml'
pull_request:
paths:
- 'ports/hsm-collector/**'
- 'versions/**'
- 'src/native/collector/**'
- '.github/workflows/hsm-collector-registry.yml'
workflow_dispatch:

jobs:
registry-consume:
runs-on: windows-latest
env:
VCPKG_DISABLE_METRICS: '1'
steps:
- uses: actions/checkout@v4

- name: Set up vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 6f29f12e82a8293156836ad81cc9bf5af41fe836

- name: Install hsm-collector from the registry port (fetches the tagged source)
shell: bash
# run-vcpkg defaults the binary cache to a GHA backend that needs tokens not reliably present
# here; override to "clear" so the port builds from source (same fix as the other consume lanes).
env:
VCPKG_BINARY_SOURCES: clear
run: |
"$VCPKG_ROOT/vcpkg" install hsm-collector --overlay-ports=ports --triplet x64-windows

- name: Build a consumer against the installed package
shell: bash
run: |
cmake -S src/native/collector/examples/console/standalone -B build/registry-consume \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_TARGET_TRIPLET=x64-windows
cmake --build build/registry-consume --config Release --parallel

- name: Verify the version database git-tree matches the port
shell: bash
# This is a supplementary registry (it provides only hsm-collector; upstream deps like
# vcpkg-cmake/curl come from the default registry), so vcpkg's whole-registry x-ci-verify-versions
# isn't applicable. Assert the one invariant that matters: versions/h-/hsm-collector.json records
# the exact git-tree of ports/hsm-collector, so git-registry consumers resolve the right port.
run: |
recorded=$(grep -oiE '[0-9a-f]{40}' versions/h-/hsm-collector.json | head -1)
actual=$(git rev-parse "HEAD:ports/hsm-collector")
echo "recorded git-tree: $recorded"
echo "actual git-tree: $actual"
if [ "$recorded" != "$actual" ]; then
echo "::error::versions/h-/hsm-collector.json git-tree is stale. Run 'vcpkg x-add-version hsm-collector' (or update it to $actual)."
exit 1
fi
echo "version database git-tree is consistent."
3 changes: 3 additions & 0 deletions ports/hsm-collector/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Native HSM DataCollector (hsm-collector).

Source: https://github.com/SoftFx/Hierarchical-Sensor-Monitoring (src/native/collector)
44 changes: 44 additions & 0 deletions ports/hsm-collector/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Registry port for the native HSM collector (hsm-collector).
#
# Unlike the in-repo OVERLAY port (src/native/collector/vcpkg-port), which builds from the adjacent
# source tree so CI can verify the current branch, this port fetches a tagged source tarball. That
# makes this repository usable as a vcpkg registry: a consumer references it and runs
# `vcpkg install hsm-collector` with no checkout of the HSM sources.
#
# To publish a new version: push a `collector-v<semver>` tag, update REF + SHA512 below and the
# version in vcpkg.json, then run `vcpkg x-add-version hsm-collector` to refresh versions/.
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO SoftFx/Hierarchical-Sensor-Monitoring
REF collector-v0.6.2
SHA512 6835207a04cb013fd370c6745e0faafe98a531ab356c896d2ec484a67eb1e978dad206fbfe1d5cf9232ade325a789c9ff3245d978bc97dac13f888bf4ca8e1b4
HEAD_REF master
)

# The collector lives in a subdirectory of the repository tarball.
set(SOURCE_PATH "${SOURCE_PATH}/src/native/collector")

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
http HSM_COLLECTOR_HTTP
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DHSM_COLLECTOR_BUILD_TESTS=OFF
-DHSM_COLLECTOR_BUILD_EXAMPLES=OFF
-DHSM_COLLECTOR_INSTALL=ON
${FEATURE_OPTIONS}
)

vcpkg_cmake_install()

# The project installs its package config to lib/cmake/hsm_collector; relocate it to the
# vcpkg-canonical share/hsm_collector and fix up the absolute paths.
vcpkg_cmake_config_fixup(PACKAGE_NAME hsm_collector CONFIG_PATH lib/cmake/hsm_collector)

# Header-only wrapper + static C core: no debug headers, and the static core has no DLLs/tools.
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_install_copyright(FILE_LIST "${CMAKE_CURRENT_LIST_DIR}/copyright")
29 changes: 29 additions & 0 deletions ports/hsm-collector/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "hsm-collector",
"version": "0.6.2",
"description": "Native C++ HSM DataCollector — stable C ABI core + header-only RAII C++ wrapper.",
"homepage": "https://github.com/SoftFx/Hierarchical-Sensor-Monitoring",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"http": {
"description": "libcurl HTTP transport (Schannel on Windows, OpenSSL elsewhere)",
"dependencies": [
{
"name": "curl",
"default-features": false,
"features": ["ssl"]
}
]
}
}
}
2 changes: 1 addition & 1 deletion src/native/collector/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HsmCollectorConan(ConanFile):
"""

name = "hsm-collector"
version = "0.4.0"
version = "0.6.2"
license = "See repository (SoftFx/Hierarchical-Sensor-Monitoring)"
url = "https://github.com/SoftFx/Hierarchical-Sensor-Monitoring"
description = "Native C++ HSM DataCollector — stable C ABI core + header-only RAII C++ wrapper."
Expand Down
2 changes: 1 addition & 1 deletion src/native/collector/vcpkg-port/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hsm-collector",
"version": "0.4.0",
"version": "0.6.2",
"description": "Native C++ HSM DataCollector — stable C ABI core + header-only RAII C++ wrapper.",
"homepage": "https://github.com/SoftFx/Hierarchical-Sensor-Monitoring",
"supports": "!uwp",
Expand Down
8 changes: 8 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"default": {
"hsm-collector": {
"baseline": "0.6.2",
"port-version": 0
}
}
}
8 changes: 8 additions & 0 deletions versions/h-/hsm-collector.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"versions": [
{
"version": "0.6.2",
"git-tree": "bbc02d7505419f4a24e6c584d4a1d9643db4b6d9"
}
]
}
Loading