From aa995c676148d1eacebe0109db2acd852bb0056a Mon Sep 17 00:00:00 2001 From: pr0uxx Date: Fri, 18 Sep 2026 13:08:12 +0100 Subject: [PATCH 01/11] version bump --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb387c0..0343403 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@software-hardware-integration-lab/log-engine", - "version": "0.0.6", + "version": "0.0.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@software-hardware-integration-lab/log-engine", - "version": "0.0.6", + "version": "0.0.7", "hasInstallScript": true, "dependencies": { "typia": "~12.1.1" diff --git a/package.json b/package.json index 2bbd790..c5a7266 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.0.6", + "version": "0.0.7", "name": "@software-hardware-integration-lab/log-engine", "description": "Logging engine with ability to add plugins for any destination", "author": { From 9f91b284041eec40f70929678424cc78a3840103 Mon Sep 17 00:00:00 2001 From: pr0uxx Date: Fri, 18 Sep 2026 13:09:39 +0100 Subject: [PATCH 02/11] Attempt to align node-version with package.json --- .github/workflows/Metadata.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/Metadata.yml b/.github/workflows/Metadata.yml index fbab80b..d462c5b 100644 --- a/.github/workflows/Metadata.yml +++ b/.github/workflows/Metadata.yml @@ -6,6 +6,9 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + #temporary on push trigger to validate if is working + push: + # Allow this workflow to be called from another workflow workflow_call: inputs: @@ -36,6 +39,9 @@ on: version: description: 'The version of the project that is being built.' value: ${{ jobs.Deploy-Metadata.outputs.version }} + nodeRuntime: + description: 'The Node.JS runtime version required by the project.' + value: ${{ jobs.Deploy-Metadata.outputs.nodeRuntime }} # Define each session of execution that should be executed jobs: @@ -58,6 +64,7 @@ jobs: environment: ${{ steps.computedGitHubEnvironment.outputs.environment }} shortSha: ${{ steps.shortSha.outputs.shortSha }} version: ${{ steps.computedVersion.outputs.version }} + nodeRuntime: ${{ steps.computedNodeRuntime.outputs.runtime }} # Set of actions to perform for this execution sandbox steps: @@ -65,6 +72,17 @@ jobs: - name: Checkout Files from Repo uses: actions/checkout@v7 + # Extract the Node.JS runtime required by the package before setting it up. + - name: Extract Required Node.JS Runtime + id: computedNodeRuntime + run: echo "runtime=$(node -p 'JSON.parse(require("node:fs").readFileSync("package.json", "utf8")).devEngines.runtime.version')" >> "$GITHUB_OUTPUT" + + # Ensure npm commands run with the Node version required by the package. + - name: Set up Node.JS Runtime + uses: actions/setup-node@v6 + with: + node-version: ${{ steps.computedNodeRuntime.outputs.runtime }} + # Extract the project version from the package.json - name: Extract Project Version id: computedVersion From acc0435c0bd3a4fa3ebcabd846454582eb70d5ff Mon Sep 17 00:00:00 2001 From: pr0uxx Date: Fri, 18 Sep 2026 13:14:15 +0100 Subject: [PATCH 03/11] Print computed version in step summary --- .github/workflows/Metadata.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/Metadata.yml b/.github/workflows/Metadata.yml index d462c5b..180a419 100644 --- a/.github/workflows/Metadata.yml +++ b/.github/workflows/Metadata.yml @@ -122,3 +122,10 @@ jobs: # Bring job back to sync execution by awaiting for all async jobs to finish before continuing - name: Steps - Convert Back To Synchronous Execution wait-all: true + + # Publish the resolved project version to the GitHub Actions job summary. + - name: Publish Metadata Summary + run: | + echo "## Build Metadata" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + echo "Project version: \`${{ steps.computedVersion.outputs.version }}\`" >> "$GITHUB_STEP_SUMMARY" From a942d74bfbd62069b5fc5b8545d79ab026fbe8b6 Mon Sep 17 00:00:00 2001 From: pr0uxx Date: Fri, 18 Sep 2026 13:47:40 +0100 Subject: [PATCH 04/11] Add minimum node runtime script --- .github/workflows/Metadata.yml | 6 +++--- scripts/get-minimum-node-runtime.ts | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 scripts/get-minimum-node-runtime.ts diff --git a/.github/workflows/Metadata.yml b/.github/workflows/Metadata.yml index 180a419..3a02717 100644 --- a/.github/workflows/Metadata.yml +++ b/.github/workflows/Metadata.yml @@ -72,14 +72,14 @@ jobs: - name: Checkout Files from Repo uses: actions/checkout@v7 - # Extract the Node.JS runtime required by the package before setting it up. + # Extract the minimum supported Node.JS runtime before setting it up. - name: Extract Required Node.JS Runtime id: computedNodeRuntime - run: echo "runtime=$(node -p 'JSON.parse(require("node:fs").readFileSync("package.json", "utf8")).devEngines.runtime.version')" >> "$GITHUB_OUTPUT" + run: echo "runtime=$(node ./scripts/get-minimum-node-runtime.ts)" >> "$GITHUB_OUTPUT" # Ensure npm commands run with the Node version required by the package. - name: Set up Node.JS Runtime - uses: actions/setup-node@v6 + uses: actions/setup-node@v7 with: node-version: ${{ steps.computedNodeRuntime.outputs.runtime }} diff --git a/scripts/get-minimum-node-runtime.ts b/scripts/get-minimum-node-runtime.ts new file mode 100644 index 0000000..1b6cfdf --- /dev/null +++ b/scripts/get-minimum-node-runtime.ts @@ -0,0 +1,22 @@ +/* + * This script is used github workflows to ensure that they run on the minimum version + * allowed in the package JSON. This centralizes node version control. + */ + +import { readFileSync } from 'node:fs'; + +/** Gets the Node.JS runtime range declared by the package. */ +const runtimeRange = JSON.parse( + readFileSync(new URL('../package.json', import.meta.url), 'utf8') +).devEngines?.runtime?.version; +if (typeof runtimeRange !== 'string') { + throw new TypeError('package.json must declare devEngines.runtime.version.'); +} + +/** Gets the minimum complete semantic version within the declared range. */ +const minimumRuntime = runtimeRange.match(/\d+\.\d+\.\d+/)?.[0]; +if (!minimumRuntime) { + throw new TypeError(`Unable to determine a minimum Node.JS runtime from "${ runtimeRange }".`); +} + +process.stdout.write(minimumRuntime); From e058b3040c6f61e6f2e79c95f7c26b0e378109e2 Mon Sep 17 00:00:00 2001 From: pr0uxx Date: Fri, 18 Sep 2026 13:49:19 +0100 Subject: [PATCH 05/11] Metadata calculates semver in place --- .github/workflows/Metadata.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Metadata.yml b/.github/workflows/Metadata.yml index 3a02717..a9daaf6 100644 --- a/.github/workflows/Metadata.yml +++ b/.github/workflows/Metadata.yml @@ -39,6 +39,9 @@ on: version: description: 'The version of the project that is being built.' value: ${{ jobs.Deploy-Metadata.outputs.version }} + semver: + description: 'The semantic version of the project that is being built.' + value: ${{ jobs.Deploy-Metadata.outputs.semver }} nodeRuntime: description: 'The Node.JS runtime version required by the project.' value: ${{ jobs.Deploy-Metadata.outputs.nodeRuntime }} @@ -123,9 +126,19 @@ jobs: - name: Steps - Convert Back To Synchronous Execution wait-all: true + # Concatenates all previous computed values to generate the semver + - name: Calculate Final Semver + id: semver + run: | + if [ "${{ steps.computedChannel.outputs.channel }}" != "stable" ]; then + echo "semver=${{ steps.computedVersion.outputs.version }}-${{ steps.computedChannel.outputs.channel }}.${{ steps.shortSha.outputs.shortSha }}" >> "$GITHUB_OUTPUT" + else + echo "semver=${{ steps.computedVersion.outputs.version }}" >> "$GITHUB_OUTPUT" + fi + # Publish the resolved project version to the GitHub Actions job summary. - name: Publish Metadata Summary run: | echo "## Build Metadata" >> "$GITHUB_STEP_SUMMARY" echo "" >> "$GITHUB_STEP_SUMMARY" - echo "Project version: \`${{ steps.computedVersion.outputs.version }}\`" >> "$GITHUB_STEP_SUMMARY" + echo "Project version: \`${{ steps.semver.outputs.semver }}\`" >> "$GITHUB_STEP_SUMMARY" From bd3a9c32fde007d63faa126d2a5d422c5de1b438 Mon Sep 17 00:00:00 2001 From: pr0uxx Date: Fri, 18 Sep 2026 13:49:34 +0100 Subject: [PATCH 06/11] Remove unused environment computation --- .github/workflows/Metadata.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/Metadata.yml b/.github/workflows/Metadata.yml index a9daaf6..83a33c5 100644 --- a/.github/workflows/Metadata.yml +++ b/.github/workflows/Metadata.yml @@ -105,17 +105,6 @@ jobs: echo "channel=alpha" >> "$GITHUB_OUTPUT" fi - # Compute the GitHub Environment to be used by the deployment - - name: Compute GitHub Environment - id: computedGitHubEnvironment - background: true - run: | - if [ "${{ github.event_name }}" = "release" ]; then - echo "environment=Azure-Privileged" >> "$GITHUB_OUTPUT" - else - echo "environment=Azure-Alpha" >> "$GITHUB_OUTPUT" - fi - # Get the first 7 chars of the SHA hash that represents the current commit that the build is operating off of. - name: Compute Short SHA - Experimental Channel id: shortSha From fcebd63ab3a087c8baa2525cd217f53473d584f5 Mon Sep 17 00:00:00 2001 From: pr0uxx Date: Fri, 18 Sep 2026 13:56:42 +0100 Subject: [PATCH 07/11] Print channel in summary --- .github/workflows/Metadata.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Metadata.yml b/.github/workflows/Metadata.yml index 83a33c5..16a575c 100644 --- a/.github/workflows/Metadata.yml +++ b/.github/workflows/Metadata.yml @@ -131,3 +131,4 @@ jobs: echo "## Build Metadata" >> "$GITHUB_STEP_SUMMARY" echo "" >> "$GITHUB_STEP_SUMMARY" echo "Project version: \`${{ steps.semver.outputs.semver }}\`" >> "$GITHUB_STEP_SUMMARY" + echo "Channel: \`${{ steps.computedChannel.outputs.channel }}\`" >> "$GITHUB_STEP_SUMMARY" From c1f51c23ddf1b3a05507463fedeb836ba9e726b4 Mon Sep 17 00:00:00 2001 From: pr0uxx Date: Fri, 18 Sep 2026 13:58:51 +0100 Subject: [PATCH 08/11] remove temp on push trigger --- .github/workflows/Metadata.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/Metadata.yml b/.github/workflows/Metadata.yml index 16a575c..a090049 100644 --- a/.github/workflows/Metadata.yml +++ b/.github/workflows/Metadata.yml @@ -6,9 +6,6 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: - #temporary on push trigger to validate if is working - push: - # Allow this workflow to be called from another workflow workflow_call: inputs: From b21e2cc8a348cdca4fb62a94fe0202888363e7ba Mon Sep 17 00:00:00 2001 From: pr0uxx Date: Fri, 18 Sep 2026 14:05:17 +0100 Subject: [PATCH 09/11] Fix bad event call condition --- .github/workflows/Build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index dd86c73..458eda5 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -49,8 +49,8 @@ jobs: # Execute the workflow uses: ./.github/workflows/Metadata.yml with: - isRelease: ${{ github.event_name == 'workflow_call' && inputs.isRelease || false }} - isPrerelease: ${{ github.event_name == 'workflow_call' && inputs.isPrerelease || false }} + isRelease: ${{ inputs.isRelease || false }} + isPrerelease: ${{ inputs.isPrerelease || false }} # Execution session that builds the artifacts that are used for deployment Build-Prod: From 06f9400f7ae8a848011f42dd78db26f99e1fb0c9 Mon Sep 17 00:00:00 2001 From: pr0uxx Date: Fri, 18 Sep 2026 14:12:26 +0100 Subject: [PATCH 10/11] tattoo version now uses precomputed semver --- .github/workflows/Build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 458eda5..609628a 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -106,7 +106,7 @@ jobs: # Update the version of SHIELD being uploaded to have a different version number to avoid SDG version conflict - name: Tattoo Version - Experimental Channel if: ${{ needs.Metadata.outputs.channel != 'stable' }} - run: npm version --no-commit-hooks --no-git-tag-version "${{ needs.Metadata.outputs.version }}-${{ needs.Metadata.outputs.channel }}.${{ needs.Metadata.outputs.shortSha }}" + run: npm version --no-commit-hooks --no-git-tag-version "${{ needs.Metadata.outputs.semver }}" # Validate package integrity before publishing (tests, coverage, and production build). - name: Validate Package Before Publish From fa0a7977d4d6c9af1b2b02d8c5d476ad3fe0aaad Mon Sep 17 00:00:00 2001 From: pr0uxx Date: Fri, 18 Sep 2026 14:13:10 +0100 Subject: [PATCH 11/11] All workflows now use central runtime script --- .github/actions/setup-ci/action.yml | 8 +++++++- .github/workflows/Build.yml | 3 +++ .github/workflows/Publish.yml | 2 +- .github/workflows/Security-Reachability.yml | 8 ++++++-- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-ci/action.yml b/.github/actions/setup-ci/action.yml index 15a354f..ef0fcf6 100644 --- a/.github/actions/setup-ci/action.yml +++ b/.github/actions/setup-ci/action.yml @@ -12,11 +12,17 @@ inputs: runs: using: composite steps: + # Read the package's minimum supported runtime so CI validates the lowest common denominator. + - name: Read Required Node.JS Runtime + id: node-runtime + shell: bash + run: echo "runtime=$(node ./scripts/get-minimum-node-runtime.ts)" >> "$GITHUB_OUTPUT" + # Enable Node.JS in the build environment - name: Install - Node.JS Runtime uses: actions/setup-node@v6 with: - node-version: 24 + node-version: ${{ steps.node-runtime.outputs.runtime }} # Set up the socket firewall binary - name: Install - Socket Firewall diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 609628a..978a1c7 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -34,6 +34,9 @@ on: packageName: description: 'The name of the generated NPM package.' value: ${{ jobs.Build-Prod.outputs.packageName }} + nodeRuntime: + description: 'The Node.JS runtime version required by the project.' + value: ${{ jobs.Metadata.outputs.nodeRuntime }} # Define each session of execution that should be executed jobs: diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index c013e03..c0a1f1f 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -53,7 +53,7 @@ jobs: uses: actions/setup-node@v6 background: true with: - node-version: 24 + node-version: ${{ needs.Build.outputs.nodeRuntime }} # Download the compiled server binary - name: Download Artifact From Build Job diff --git a/.github/workflows/Security-Reachability.yml b/.github/workflows/Security-Reachability.yml index a6277d6..d2b3c2b 100644 --- a/.github/workflows/Security-Reachability.yml +++ b/.github/workflows/Security-Reachability.yml @@ -39,17 +39,21 @@ jobs: # Downloads the repo at the specified depth calculated previously - name: Clone Repo uses: actions/checkout@v7 - background: true with: # For PRs, fetch one additional commit for proper diff analysis fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} + # Read the package's minimum supported runtime so CI validates the lowest common denominator. + - name: Read Required Node.JS Runtime + id: node-runtime + run: echo "runtime=$(node ./scripts/get-minimum-node-runtime.ts)" >> "$GITHUB_OUTPUT" + # Set up NodeJS on the build host with caching support to optimize execution - name: Set up Node.js uses: actions/setup-node@v6 background: true with: - node-version: 24 + node-version: ${{ steps.node-runtime.outputs.runtime }} # Set up Python runtime on the build host - name: Set up Python