From 01f00703672519e271fb545be3d201255d074cdb Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:09:15 +0100 Subject: [PATCH 01/44] feat: refactor, added documentation --- CMakeLists.txt | 4 ++-- jsr/.gitignore | 4 ++++ jsr/{package => }/README.md | 0 jsr/{package => }/jsr.json.in | 5 +++-- jsr/package/.gitignore | 1 - jsr/src/bin/index.ts | 17 +++++++++++++++++ 6 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 jsr/.gitignore rename jsr/{package => }/README.md (100%) rename jsr/{package => }/jsr.json.in (56%) delete mode 100644 jsr/package/.gitignore create mode 100644 jsr/src/bin/index.ts diff --git a/CMakeLists.txt b/CMakeLists.txt index 5046ac8..292fb97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,8 +26,8 @@ project( # Generate JSR package metadata from the same git-derived version as the library. # We generate into the build directory to avoid touching tracked files during normal local builds. configure_file( - "${CMAKE_SOURCE_DIR}/jsr/package/jsr.json.in" - "${CMAKE_SOURCE_DIR}/jsr/package/jsr.json" + "${CMAKE_SOURCE_DIR}/jsr/jsr.json.in" + "${CMAKE_SOURCE_DIR}/jsr/jsr.json" @ONLY ) diff --git a/jsr/.gitignore b/jsr/.gitignore new file mode 100644 index 0000000..f61c45e --- /dev/null +++ b/jsr/.gitignore @@ -0,0 +1,4 @@ +jsr.json + +bin/ +!src/bin/ diff --git a/jsr/package/README.md b/jsr/README.md similarity index 100% rename from jsr/package/README.md rename to jsr/README.md diff --git a/jsr/package/jsr.json.in b/jsr/jsr.json.in similarity index 56% rename from jsr/package/jsr.json.in rename to jsr/jsr.json.in index 0cbcaf8..ea78f8e 100644 --- a/jsr/package/jsr.json.in +++ b/jsr/jsr.json.in @@ -2,15 +2,16 @@ "name": "@serial/cpp-bindings-linux", "version": "@PROJECT_VERSION@", "license": "LICENSE", - "description": "Linux shared-library bindings for Serial-IO/cpp-core (distributed via JSON/base64 because JSR has limited binary support).", + "description": "C++ Linux Bindings for the serial library", "exports": { - "./bin/x86_64": "./bin/x86_64.json" + "./bin": "./src/bin/index.ts" }, "publish": { "include": [ "README.md", "LICENSE", "jsr.json", + "src/**", "bin/**" ] } diff --git a/jsr/package/.gitignore b/jsr/package/.gitignore deleted file mode 100644 index d062c58..0000000 --- a/jsr/package/.gitignore +++ /dev/null @@ -1 +0,0 @@ -jsr.json diff --git a/jsr/src/bin/index.ts b/jsr/src/bin/index.ts new file mode 100644 index 0000000..66555bc --- /dev/null +++ b/jsr/src/bin/index.ts @@ -0,0 +1,17 @@ +/** + * Module that provides exports for serialized binary files. + * + * @example + * Import the corresponding binary and write the file to disk. + * + * ```ts + * import {x86_64} from '@serial/cpp-bindings-linux/bin' + * + * Deno.writeFileSync(`./${x86_64.filename}`, Uint8Array.fromBase64(x86_64.data)) + * ``` + * @module + */ + +import x86_64 from '../../bin/x86_64.json' with { type: "json" } + +export {x86_64} From 012a18d667a8696d5d0ae0f0df660e61727f9876 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:37:09 +0100 Subject: [PATCH 02/44] fix: refactor build and publish workflows --- .../{build-deno-so.yml => build_binary.yml} | 40 +++++----- .github/workflows/publish-jsr.yml | 73 ------------------- .github/workflows/publish_jsr.yml | 51 +++++++++++++ 3 files changed, 70 insertions(+), 94 deletions(-) rename .github/workflows/{build-deno-so.yml => build_binary.yml} (51%) delete mode 100644 .github/workflows/publish-jsr.yml create mode 100644 .github/workflows/publish_jsr.yml diff --git a/.github/workflows/build-deno-so.yml b/.github/workflows/build_binary.yml similarity index 51% rename from .github/workflows/build-deno-so.yml rename to .github/workflows/build_binary.yml index 7523a80..38f3b4f 100644 --- a/.github/workflows/build-deno-so.yml +++ b/.github/workflows/build_binary.yml @@ -1,55 +1,53 @@ -name: Build Deno Shared Library +name: 'Build Binary' +description: | + This workflow builds the binary files for Linux. The build binaries are stored as artifact + and may be reused by other workflows. on: push: - branches: [ main, master ] - pull_request: + branches: [ main ] + + pull_request: {} jobs: - build-deno-so: - name: Build shared library for Deno + build-binary: + name: 'Build Binary' runs-on: ubuntu-latest container: image: ubuntu:24.04 steps: - - name: Checkout repository + - name: 'Checkout repository' uses: actions/checkout@v4 - - name: Install build dependencies + - name: 'Install dependencies' env: DEBIAN_FRONTEND: noninteractive + run: | apt-get update apt-get install -y --no-install-recommends ninja-build g++ git ca-certificates rm -rf /var/lib/apt/lists/* - - name: Setup CMake >= 3.30 + - name: 'Setup CMake >= 3.30' uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.31.x' - - name: Configure CMake (Release) + - name: 'Configure CMake (Release)' env: CXX: g++ + run: | cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release - - name: Build shared library + - name: 'Build binary' run: | cmake --build build --config Release - - name: Collect shared library artifact - run: | - mkdir -p deno-lib/linux-x86_64 - cp build/libcpp_bindings_linux.so* deno-lib/linux-x86_64/ - ls -R deno-lib - - - name: Upload .so artifact for Deno + - name: 'Upload artifacts' uses: actions/upload-artifact@v4 with: - name: cpp-bindings-linux-so-linux-x86_64 - path: deno-lib/** - - + name: libcpp_bindings_linux_x86_64 + path: build/libcpp_bindings_linux.so* diff --git a/.github/workflows/publish-jsr.yml b/.github/workflows/publish-jsr.yml deleted file mode 100644 index 71bc996..0000000 --- a/.github/workflows/publish-jsr.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Publish to JSR (@serial/cpp-bindings-linux) - -on: - workflow_dispatch: - inputs: {} - - push: - branches: - - '*' - - tags: - - "v*" - -permissions: - contents: read - id-token: write - -jobs: - publish-jsr: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install build dependencies - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends ninja-build g++ git ca-certificates - - - name: Setup CMake >= 3.30 - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: "3.31.x" - - - name: Setup Deno - uses: denoland/setup-deno@v2 - with: - deno-version: "2.x" - - - name: Configure CMake (Release) - env: - CXX: g++ - run: | - cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release - - - name: Build shared library - run: | - cmake --build build --config Release - - - name: Embed binary as JSON/base64 for JSR - run: | - ./jsr/scripts/embed_binary.sh \ - ./build/libcpp_bindings_linux.so \ - ./jsr/package/bin \ - linux-x86_64 - cp LICENSE ./jsr/package/LICENSE - - - name: Publish package to JSR (real) - if: github.ref_type == 'tag' - working-directory: jsr/package - run: | - deno publish --allow-dirty - - - name: Publish package to JSR (dry-run) - if: github.ref_type != 'tag' - working-directory: jsr/package - run: | - deno publish --allow-dirty --dry-run diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml new file mode 100644 index 0000000..d22190e --- /dev/null +++ b/.github/workflows/publish_jsr.yml @@ -0,0 +1,51 @@ +name: 'Publish JSR' +description: | + This workflow serializes the build binary to Base64 and generates a JSON file with meta data about the file. + The file then gets published to JSR (@serial/cpp-bindings-linux). + +on: + workflow_run: + workflows: ["Build Binary"] + types: + - completed + +permissions: + contents: read + id-token: write + +jobs: + publish-jsr: + runs-on: ubuntu-latest + + steps: + - name: 'Checkout repository' + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 'Setup Deno' + uses: denoland/setup-deno@v2 + with: + deno-version: '2.x' + + - name: 'Download artifact' + uses: actions/download-artifact@v4 + with: + path: 'artifacts' + name: 'libcpp_bindings_linux_x86_64' + run-id: ${{ github.event.workflow_run.id }} + + - name: 'Prepare files for JSR' + run: | + cp LICENSE ./jsr/LICENSE + + ./jsr/scripts/embed_binary.sh \ + ./artifacts/libcpp_bindings_linux.so \ + ./jsr/bin \ + linux-x86_64 + + - name: 'Publish package to JSR' + working-directory: jsr + run: | + deno publish --allow-dirty + From 2df8bee72f1c2df8df98515e4dd1af1556f05b7b Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 08:33:51 +0100 Subject: [PATCH 03/44] Update publish_jsr.yml --- .github/workflows/publish_jsr.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml index d22190e..c6ccfcf 100644 --- a/.github/workflows/publish_jsr.yml +++ b/.github/workflows/publish_jsr.yml @@ -45,7 +45,14 @@ jobs: linux-x86_64 - name: 'Publish package to JSR' + if: github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main' working-directory: jsr run: | deno publish --allow-dirty + - name: 'Publish package to JSR (dry-run)' + if: github.event.workflow_run.event == 'pull_request' + working-directory: jsr + run: | + deno publish --allow-dirty --dry-run + From e0f10fc158e67c7225b24baade2a654b26f1089a Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 08:44:39 +0100 Subject: [PATCH 04/44] fix: renamed worflow files --- .github/workflows/{cpp-tests.yml => cpp_tests.yml} | 0 .github/workflows/{deno-tests.yml => deno_tests.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{cpp-tests.yml => cpp_tests.yml} (100%) rename .github/workflows/{deno-tests.yml => deno_tests.yml} (100%) diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp_tests.yml similarity index 100% rename from .github/workflows/cpp-tests.yml rename to .github/workflows/cpp_tests.yml diff --git a/.github/workflows/deno-tests.yml b/.github/workflows/deno_tests.yml similarity index 100% rename from .github/workflows/deno-tests.yml rename to .github/workflows/deno_tests.yml From 33c2765800512fab416d24fcf2c8aae2e1f9170a Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 08:44:57 +0100 Subject: [PATCH 05/44] fix: publish on separate branch --- .github/workflows/publish_jsr.yml | 58 ------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 .github/workflows/publish_jsr.yml diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml deleted file mode 100644 index c6ccfcf..0000000 --- a/.github/workflows/publish_jsr.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: 'Publish JSR' -description: | - This workflow serializes the build binary to Base64 and generates a JSON file with meta data about the file. - The file then gets published to JSR (@serial/cpp-bindings-linux). - -on: - workflow_run: - workflows: ["Build Binary"] - types: - - completed - -permissions: - contents: read - id-token: write - -jobs: - publish-jsr: - runs-on: ubuntu-latest - - steps: - - name: 'Checkout repository' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: 'Setup Deno' - uses: denoland/setup-deno@v2 - with: - deno-version: '2.x' - - - name: 'Download artifact' - uses: actions/download-artifact@v4 - with: - path: 'artifacts' - name: 'libcpp_bindings_linux_x86_64' - run-id: ${{ github.event.workflow_run.id }} - - - name: 'Prepare files for JSR' - run: | - cp LICENSE ./jsr/LICENSE - - ./jsr/scripts/embed_binary.sh \ - ./artifacts/libcpp_bindings_linux.so \ - ./jsr/bin \ - linux-x86_64 - - - name: 'Publish package to JSR' - if: github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main' - working-directory: jsr - run: | - deno publish --allow-dirty - - - name: 'Publish package to JSR (dry-run)' - if: github.event.workflow_run.event == 'pull_request' - working-directory: jsr - run: | - deno publish --allow-dirty --dry-run - From af332b75e111d887f9a6910cb266d76d35ba7408 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 09:17:04 +0100 Subject: [PATCH 06/44] feat: Also publish jsr.json --- .github/workflows/build_binary.yml | 8 +++++++- CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 38f3b4f..1b4adf8 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -46,8 +46,14 @@ jobs: run: | cmake --build build --config Release - - name: 'Upload artifacts' + - name: 'Upload artifacts (binary)' uses: actions/upload-artifact@v4 with: name: libcpp_bindings_linux_x86_64 path: build/libcpp_bindings_linux.so* + + - name: 'Upload artifacts (JSR)' + uses: actions/upload-artifact@v4 + with: + name: jsr_json + path: build/jsr/jsr.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 292fb97..0bf4f89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ project( # We generate into the build directory to avoid touching tracked files during normal local builds. configure_file( "${CMAKE_SOURCE_DIR}/jsr/jsr.json.in" - "${CMAKE_SOURCE_DIR}/jsr/jsr.json" + "${CMAKE_BINARY_DIR}/jsr/jsr.json" @ONLY ) From 59810ecaf6a466b877bac82bc973bcf8de1bfeed Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 10:43:51 +0100 Subject: [PATCH 07/44] feat: Refactor --- .github/workflows/build_binary.yml | 24 +++++++--- .github/workflows/publish_jsr.yml | 71 ++++++++++++++++++++++++++++++ CMakeLists.txt | 8 +--- 3 files changed, 89 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/publish_jsr.yml diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 1b4adf8..1f2dc5b 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -42,18 +42,28 @@ jobs: run: | cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release - - name: 'Build binary' + - name: 'Build' + id: 'build' run: | cmake --build build --config Release - - name: 'Upload artifacts (binary)' + VERSION=$(cat build/version.txt) + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + + - name: 'Upload artifacts' uses: actions/upload-artifact@v4 with: name: libcpp_bindings_linux_x86_64 path: build/libcpp_bindings_linux.so* + + outputs: + version: ${{ steps.build.outputs.VERSION }} + + trigger-publish: + needs: ['build-binary'] + uses: ./.github/workflows/publish_jsr.yml + with: + publish: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + version: ${{ needs.build-binary.outputs.version }} + artifact-name: libcpp_bindings_linux_x86_64 - - name: 'Upload artifacts (JSR)' - uses: actions/upload-artifact@v4 - with: - name: jsr_json - path: build/jsr/jsr.json diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml new file mode 100644 index 0000000..ece6ebc --- /dev/null +++ b/.github/workflows/publish_jsr.yml @@ -0,0 +1,71 @@ +name: 'Publish JSR' +description: | + This workflow serializes the build binary to Base64 and generates a JSON file with meta data about the file. + The file then gets published to JSR (@serial/cpp-bindings-linux). + +on: + workflow_call: + inputs: + publish: + description: 'Whether to actually publish' + required: true + type: boolean + + version: + description: 'Package version' + required: true + type: string + + artifact-name: + description: 'Name of the artifact' + required: true + type: string + +permissions: + contents: read + id-token: write + +jobs: + publish-jsr: + runs-on: ubuntu-latest + + steps: + - name: 'Checkout repository' + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 'Setup Deno' + uses: denoland/setup-deno@v2 + with: + deno-version: '2.x' + + - name: 'Download artifact (binary)' + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.artifact-name }} + path: 'artifacts' + + - name: 'Prepare files for JSR' + run: | + cp ./LICENSE ./jsr/LICENSE + + sed "s/@PROJECT_VERSION@/${{ inputs.version }}/g" jsr/jsr.json.in > jsr/jsr.json + + ./jsr/scripts/embed_binary.sh \ + ./artifacts/libcpp_bindings_linux.so \ + ./jsr/bin \ + linux-x86_64 + + - name: 'Publish package to JSR' + if: inputs.publish + working-directory: jsr + run: | + deno publish --allow-dirty + + - name: 'Publish package to JSR (dry-run)' + if: ${{ !inputs.publish }} + working-directory: jsr + run: | + deno publish --allow-dirty --dry-run + diff --git a/CMakeLists.txt b/CMakeLists.txt index 0bf4f89..009b31e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,13 +23,7 @@ project( LANGUAGES CXX ) -# Generate JSR package metadata from the same git-derived version as the library. -# We generate into the build directory to avoid touching tracked files during normal local builds. -configure_file( - "${CMAKE_SOURCE_DIR}/jsr/jsr.json.in" - "${CMAKE_BINARY_DIR}/jsr/jsr.json" - @ONLY -) +file(WRITE "${CMAKE_BINARY_DIR}/version.txt" "${PROJECT_VERSION}") # Set C++ standard set(CMAKE_CXX_STANDARD 23) From f2c0c36479a91f840b5dcaa5317ea7798b90d6e3 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 10:47:44 +0100 Subject: [PATCH 08/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 1f2dc5b..7f6ff24 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -66,4 +66,5 @@ jobs: publish: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} version: ${{ needs.build-binary.outputs.version }} artifact-name: libcpp_bindings_linux_x86_64 - + + secrets: inherit From 09d971e53311dbfcfcbe38fc466398489eda1135 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 10:49:39 +0100 Subject: [PATCH 09/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 7f6ff24..96370fa 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -9,6 +9,10 @@ on: pull_request: {} +permissions: + contents: read + id-token: write + jobs: build-binary: name: 'Build Binary' @@ -66,5 +70,3 @@ jobs: publish: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} version: ${{ needs.build-binary.outputs.version }} artifact-name: libcpp_bindings_linux_x86_64 - - secrets: inherit From e43bf6346dd93215472d6bcb9d41d06fa6fec1d8 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 10:53:00 +0100 Subject: [PATCH 10/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 96370fa..de473db 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -9,10 +9,6 @@ on: pull_request: {} -permissions: - contents: read - id-token: write - jobs: build-binary: name: 'Build Binary' @@ -70,3 +66,7 @@ jobs: publish: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} version: ${{ needs.build-binary.outputs.version }} artifact-name: libcpp_bindings_linux_x86_64 + + permissions: + contents: read + id-token: write From e0c3d525656974bfa582b9688b500e4cfe702213 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 10:55:03 +0100 Subject: [PATCH 11/44] Update jsr.json.in --- jsr/jsr.json.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jsr/jsr.json.in b/jsr/jsr.json.in index ea78f8e..22caa5f 100644 --- a/jsr/jsr.json.in +++ b/jsr/jsr.json.in @@ -13,6 +13,9 @@ "jsr.json", "src/**", "bin/**" + ], + "exclude": [ + "!bin/**" ] } } From 25972c340ff2f158ab87243beb929d3036cd1a0d Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 10:55:59 +0100 Subject: [PATCH 12/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index de473db..5322701 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -35,7 +35,7 @@ jobs: with: cmake-version: '3.31.x' - - name: 'Configure CMake (Release)' + - name: 'Configure CMake' env: CXX: g++ From 4be407f9d348c2f7b2c87acae9cf3f4ed758e341 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 10:57:40 +0100 Subject: [PATCH 13/44] Update jsr.json.in --- jsr/jsr.json.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsr/jsr.json.in b/jsr/jsr.json.in index 22caa5f..edeffc2 100644 --- a/jsr/jsr.json.in +++ b/jsr/jsr.json.in @@ -15,7 +15,7 @@ "bin/**" ], "exclude": [ - "!bin/**" + "!bin/" ] } } From df84c179454b1eb8a1000385710a49f93c3acf76 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 10:58:25 +0100 Subject: [PATCH 14/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 5322701..b11c382 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -30,7 +30,7 @@ jobs: apt-get install -y --no-install-recommends ninja-build g++ git ca-certificates rm -rf /var/lib/apt/lists/* - - name: 'Setup CMake >= 3.30' + - name: 'Setup CMake' uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.31.x' From b2d24cfb4729bdd57980820d2470b3c15bd9054f Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:01:23 +0100 Subject: [PATCH 15/44] Update embed_binary.sh --- jsr/scripts/embed_binary.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/jsr/scripts/embed_binary.sh b/jsr/scripts/embed_binary.sh index 2f500dd..3396814 100755 --- a/jsr/scripts/embed_binary.sh +++ b/jsr/scripts/embed_binary.sh @@ -19,8 +19,6 @@ FILENAME=$(basename "$BINARY_PATH") mkdir -p "$JSR_BIN_PATH" -cp "$BINARY_PATH" "$JSR_BIN_PATH/x86_64.so" - BASE64_DATA=$(base64 "$BINARY_PATH" | tr -d '\n') jq -n \ From ad68ba236978a3ea75484884460e776d65ad7858 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:01:44 +0100 Subject: [PATCH 16/44] Update embed_binary.sh --- jsr/scripts/embed_binary.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jsr/scripts/embed_binary.sh b/jsr/scripts/embed_binary.sh index 3396814..2f500dd 100755 --- a/jsr/scripts/embed_binary.sh +++ b/jsr/scripts/embed_binary.sh @@ -19,6 +19,8 @@ FILENAME=$(basename "$BINARY_PATH") mkdir -p "$JSR_BIN_PATH" +cp "$BINARY_PATH" "$JSR_BIN_PATH/x86_64.so" + BASE64_DATA=$(base64 "$BINARY_PATH" | tr -d '\n') jq -n \ From ac43fe220b788af2b374862fa38e9c2332baae2b Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:05:25 +0100 Subject: [PATCH 17/44] Update publish_jsr.yml --- .github/workflows/publish_jsr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml index ece6ebc..061c8a2 100644 --- a/.github/workflows/publish_jsr.yml +++ b/.github/workflows/publish_jsr.yml @@ -49,6 +49,8 @@ jobs: - name: 'Prepare files for JSR' run: | cp ./LICENSE ./jsr/LICENSE + + cp ./artifacts/libcpp_bindings_linux.so ./jsr/bin/x86_64.so sed "s/@PROJECT_VERSION@/${{ inputs.version }}/g" jsr/jsr.json.in > jsr/jsr.json From d002eaca15d1542da214f85b67eb2c4445a01288 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:05:27 +0100 Subject: [PATCH 18/44] Update embed_binary.sh --- jsr/scripts/embed_binary.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/jsr/scripts/embed_binary.sh b/jsr/scripts/embed_binary.sh index 2f500dd..3396814 100755 --- a/jsr/scripts/embed_binary.sh +++ b/jsr/scripts/embed_binary.sh @@ -19,8 +19,6 @@ FILENAME=$(basename "$BINARY_PATH") mkdir -p "$JSR_BIN_PATH" -cp "$BINARY_PATH" "$JSR_BIN_PATH/x86_64.so" - BASE64_DATA=$(base64 "$BINARY_PATH" | tr -d '\n') jq -n \ From 6a2c11254e81fe3ed216e33750fbdf7c8f5508f4 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:33:43 +0100 Subject: [PATCH 19/44] fix: use sh instead of txt and source it --- .github/workflows/build_binary.yml | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index b11c382..2822103 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -47,7 +47,7 @@ jobs: run: | cmake --build build --config Release - VERSION=$(cat build/version.txt) + source build/version.sh echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - name: 'Upload artifacts' diff --git a/CMakeLists.txt b/CMakeLists.txt index 009b31e..17318c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ project( LANGUAGES CXX ) -file(WRITE "${CMAKE_BINARY_DIR}/version.txt" "${PROJECT_VERSION}") +file(WRITE "${CMAKE_BINARY_DIR}/env.sh" "VERSION=${PROJECT_VERSION}") # Set C++ standard set(CMAKE_CXX_STANDARD 23) From a089bc02ff6c26b93dc49b40e13aebdad26843de Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 12:01:54 +0100 Subject: [PATCH 20/44] fix: env --- .github/workflows/build_binary.yml | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 2822103..e93e2db 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -47,7 +47,7 @@ jobs: run: | cmake --build build --config Release - source build/version.sh + . build/env.sh echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - name: 'Upload artifacts' diff --git a/CMakeLists.txt b/CMakeLists.txt index 17318c8..9fc58ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ project( LANGUAGES CXX ) -file(WRITE "${CMAKE_BINARY_DIR}/env.sh" "VERSION=${PROJECT_VERSION}") +file(WRITE "${CMAKE_BINARY_DIR}/env.sh" "export VERSION=${PROJECT_VERSION}") # Set C++ standard set(CMAKE_CXX_STANDARD 23) From a298763527bfae97fd73cd8b85d2fc7649e47b2a Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 12:04:03 +0100 Subject: [PATCH 21/44] Update publish_jsr.yml --- .github/workflows/publish_jsr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml index 061c8a2..c6ed686 100644 --- a/.github/workflows/publish_jsr.yml +++ b/.github/workflows/publish_jsr.yml @@ -48,8 +48,9 @@ jobs: - name: 'Prepare files for JSR' run: | - cp ./LICENSE ./jsr/LICENSE + mkdir -p ./jsr/bin + cp ./LICENSE ./jsr/LICENSE cp ./artifacts/libcpp_bindings_linux.so ./jsr/bin/x86_64.so sed "s/@PROJECT_VERSION@/${{ inputs.version }}/g" jsr/jsr.json.in > jsr/jsr.json From 0d82a0df3755a447c4f37d8f0dab7195c5945c40 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:30:41 +0100 Subject: [PATCH 22/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index e93e2db..b0349f5 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -60,6 +60,7 @@ jobs: version: ${{ steps.build.outputs.VERSION }} trigger-publish: + name: 'Trigger Publish' needs: ['build-binary'] uses: ./.github/workflows/publish_jsr.yml with: From 59f82130ddcb5d0d7b7e3cc03a039218db7519f3 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:50:00 +0100 Subject: [PATCH 23/44] fix: renamed --- jsr/scripts/{embed_binary.sh => binary_to_json.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jsr/scripts/{embed_binary.sh => binary_to_json.sh} (100%) mode change 100755 => 100644 diff --git a/jsr/scripts/embed_binary.sh b/jsr/scripts/binary_to_json.sh old mode 100755 new mode 100644 similarity index 100% rename from jsr/scripts/embed_binary.sh rename to jsr/scripts/binary_to_json.sh From 3712b9bfbc32eb5defe3152f3693157c8a46f726 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:50:03 +0100 Subject: [PATCH 24/44] Update publish_jsr.yml --- .github/workflows/publish_jsr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml index c6ed686..b3ac19c 100644 --- a/.github/workflows/publish_jsr.yml +++ b/.github/workflows/publish_jsr.yml @@ -55,7 +55,7 @@ jobs: sed "s/@PROJECT_VERSION@/${{ inputs.version }}/g" jsr/jsr.json.in > jsr/jsr.json - ./jsr/scripts/embed_binary.sh \ + ./jsr/scripts/binary_to_json.sh \ ./artifacts/libcpp_bindings_linux.so \ ./jsr/bin \ linux-x86_64 From 2fcc0f62de474f1410e5682509cb0697a28b2ce0 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:56:37 +0100 Subject: [PATCH 25/44] fix: refactor varaible naming --- .github/workflows/publish_jsr.yml | 2 +- jsr/scripts/binary_to_json.sh | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml index b3ac19c..8b13a13 100644 --- a/.github/workflows/publish_jsr.yml +++ b/.github/workflows/publish_jsr.yml @@ -57,7 +57,7 @@ jobs: ./jsr/scripts/binary_to_json.sh \ ./artifacts/libcpp_bindings_linux.so \ - ./jsr/bin \ + ./jsr/bin/x86_64.json \ linux-x86_64 - name: 'Publish package to JSR' diff --git a/jsr/scripts/binary_to_json.sh b/jsr/scripts/binary_to_json.sh index 3396814..f4240aa 100644 --- a/jsr/scripts/binary_to_json.sh +++ b/jsr/scripts/binary_to_json.sh @@ -2,24 +2,24 @@ set -eu if [ "$#" -ne 3 ]; then - echo "Usage: $0 " >&2 + echo "Usage: $0 " >&2 exit 1 fi -BINARY_PATH=$1 -JSR_BIN_PATH=$2 +BINARY_FILE_PATH=$1 +JSON_FILE_PATH=$2 TARGET=$3 -if [ ! -f "$BINARY_PATH" ]; then - echo "Error: Binary path is not a file: $BINARY_PATH" >&2 +if [ ! -f "$BINARY_FILE_PATH" ]; then + echo "Error: Binary path is not a file: $BINARY_FILE_PATH" >&2 exit 1 fi -FILENAME=$(basename "$BINARY_PATH") +FILENAME=$(basename "$BINARY_FILE_PATH") -mkdir -p "$JSR_BIN_PATH" +mkdir -p $(basename "$JSON_FILE_PATH") -BASE64_DATA=$(base64 "$BINARY_PATH" | tr -d '\n') +BASE64_DATA=$(base64 "$BINARY_FILE_PATH" | tr -d '\n') jq -n \ --arg target "$TARGET" \ @@ -30,4 +30,4 @@ jq -n \ filename: $filename, encoding: "base64", data: $data - }' > "$JSR_BIN_PATH/x86_64.json" + }' > "$JSON_FILE_PATH" From 0e3be9963a59fc2e8e1b22bb0b5ade61a7f00f4e Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:59:44 +0100 Subject: [PATCH 26/44] fix: Permissions --- jsr/scripts/binary_to_json.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 jsr/scripts/binary_to_json.sh diff --git a/jsr/scripts/binary_to_json.sh b/jsr/scripts/binary_to_json.sh old mode 100644 new mode 100755 From 7f3405c2b1c62dbe96a7aa131bbb129beef85c6e Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:17:16 +0100 Subject: [PATCH 27/44] fix: Permissions --- jsr/scripts/set_version.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 jsr/scripts/set_version.sh diff --git a/jsr/scripts/set_version.sh b/jsr/scripts/set_version.sh new file mode 100755 index 0000000..837cbf5 --- /dev/null +++ b/jsr/scripts/set_version.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -eu + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +JSON_FILE_PATH=$1 +VERSION=$2 + +temp_json_file="$(mktemp)" + +sed "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" \ + "$JSON_FILE_PATH" > "$temp_json_file" + +mv "$temp_json_file" "$JSON_FILE_PATH" From e4c0e890c912ce9d4e26b8b943c259ee08f88274 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:18:38 +0100 Subject: [PATCH 28/44] feat: Changed version generation --- .github/workflows/publish_jsr.yml | 3 +- jsr/.gitignore | 2 - jsr/LICENSE | 298 ++++++++++++++++++++++++++++++ jsr/{jsr.json.in => jsr.json} | 2 +- 4 files changed, 300 insertions(+), 5 deletions(-) create mode 100644 jsr/LICENSE rename jsr/{jsr.json.in => jsr.json} (91%) diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml index 8b13a13..497e19d 100644 --- a/.github/workflows/publish_jsr.yml +++ b/.github/workflows/publish_jsr.yml @@ -50,10 +50,9 @@ jobs: run: | mkdir -p ./jsr/bin - cp ./LICENSE ./jsr/LICENSE cp ./artifacts/libcpp_bindings_linux.so ./jsr/bin/x86_64.so - sed "s/@PROJECT_VERSION@/${{ inputs.version }}/g" jsr/jsr.json.in > jsr/jsr.json + ./jsr/scripts/set_version.sh jsr/jsr.json "${{ inputs.version }}" ./jsr/scripts/binary_to_json.sh \ ./artifacts/libcpp_bindings_linux.so \ diff --git a/jsr/.gitignore b/jsr/.gitignore index f61c45e..0e547b0 100644 --- a/jsr/.gitignore +++ b/jsr/.gitignore @@ -1,4 +1,2 @@ -jsr.json - bin/ !src/bin/ diff --git a/jsr/LICENSE b/jsr/LICENSE new file mode 100644 index 0000000..fd8cd28 --- /dev/null +++ b/jsr/LICENSE @@ -0,0 +1,298 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version of + the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is necessary + to install and execute a modified version of the Combined Work + produced by recombining or relinking the Application with a modified + version of the Linked Version. (If you use option 4d0, the + Installation Information must accompany the Minimal Corresponding + Source and Corresponding Application Code. If you use option 4d1, you + must provide the Installation Information in the manner specified by + section 6 of the GNU GPL for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + + 7. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 8. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or run +a copy of the Library. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + 11. Patents. + + A contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange to extend the +patent license to downstream recipients. "Knowingly relying" means you +have actual knowledge that, but for the patent license, your conveying +the covered work in a country, or your recipient's use of the covered +work in a country, would infringe one or more identifiable patents in +that country. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + If you convey a covered work, you may not impose any further +restrictions on the exercise of the rights granted or affirmed under +this License. For example, you may not impose a license fee, royalty, +or other charge for exercise of rights granted under this License, and +you may not initiate litigation (including a cross-claim or +counterclaim in a lawsuit) alleging that any patent claim is infringed +by making, using, selling, offering for sale, or importing the Program +or any portion of it. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combined work as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Lesser General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail +to address new problems or concerns. + + Each version is given a distinguishing version number. If the Library as +you received it specifies that a certain numbered version of the GNU Lesser +General Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that published +version or of any later version published by the Free Software Foundation. +If the Library as you received it does not specify a version number of the +GNU Lesser General Public License, you may choose any version of the GNU +Lesser General Public License ever published by the Free Software +Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the Library. + + END OF TERMS AND CONDITIONS + + diff --git a/jsr/jsr.json.in b/jsr/jsr.json similarity index 91% rename from jsr/jsr.json.in rename to jsr/jsr.json index edeffc2..2e235da 100644 --- a/jsr/jsr.json.in +++ b/jsr/jsr.json @@ -1,6 +1,6 @@ { "name": "@serial/cpp-bindings-linux", - "version": "@PROJECT_VERSION@", + "version": "0.1.0", "license": "LICENSE", "description": "C++ Linux Bindings for the serial library", "exports": { From 94007b2f5ed4f54e13974b8a8f6940e9de865bec Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:32:21 +0100 Subject: [PATCH 29/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index b0349f5..2dac58b 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -48,6 +48,7 @@ jobs: cmake --build build --config Release . build/env.sh + echo "Setting Version \"$VERSION\"" echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - name: 'Upload artifacts' From 7a543cb7f3531f6d80b927ca259a17270f46c425 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:36:56 +0100 Subject: [PATCH 30/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 2dac58b..fc01d71 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -20,6 +20,8 @@ jobs: steps: - name: 'Checkout repository' uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: 'Install dependencies' env: From 18611aecc3a12d95ec9d8fba6db5570afa53c025 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:38:54 +0100 Subject: [PATCH 31/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index fc01d71..9631106 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -50,7 +50,7 @@ jobs: cmake --build build --config Release . build/env.sh - echo "Setting Version \"$VERSION\"" + cat build/env.sh echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - name: 'Upload artifacts' From a88b9c2d404f32973e85acdd30d1db32b440d605 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:43:16 +0100 Subject: [PATCH 32/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 9631106..06887e7 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -21,6 +21,7 @@ jobs: - name: 'Checkout repository' uses: actions/checkout@v4 with: + fetch-tags: true fetch-depth: 0 - name: 'Install dependencies' From 0b6ab38a8b9c38fca483b2a2e4d36bc4efbd090e Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:46:45 +0100 Subject: [PATCH 33/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 06887e7..cc7d3e2 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -21,7 +21,6 @@ jobs: - name: 'Checkout repository' uses: actions/checkout@v4 with: - fetch-tags: true fetch-depth: 0 - name: 'Install dependencies' @@ -29,6 +28,8 @@ jobs: DEBIAN_FRONTEND: noninteractive run: | + git tag + apt-get update apt-get install -y --no-install-recommends ninja-build g++ git ca-certificates rm -rf /var/lib/apt/lists/* @@ -51,7 +52,6 @@ jobs: cmake --build build --config Release . build/env.sh - cat build/env.sh echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - name: 'Upload artifacts' From 9c5a34c94e682a0e90cc69c45f6e2beec8c4ff55 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:46:47 +0100 Subject: [PATCH 34/44] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fc58ad..f56632b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ project( LANGUAGES CXX ) -file(WRITE "${CMAKE_BINARY_DIR}/env.sh" "export VERSION=${PROJECT_VERSION}") +file(WRITE "${CMAKE_BINARY_DIR}/env.sh" "export VERSION=${GIT_DESCRIBE}") # Set C++ standard set(CMAKE_CXX_STANDARD 23) From 2e600e67814177c93636194369886718e6ea21f6 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:51:52 +0100 Subject: [PATCH 35/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index cc7d3e2..8226cbb 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -28,8 +28,6 @@ jobs: DEBIAN_FRONTEND: noninteractive run: | - git tag - apt-get update apt-get install -y --no-install-recommends ninja-build g++ git ca-certificates rm -rf /var/lib/apt/lists/* From dc7575cdf2cf3ec61304c7e6bdffd41fd0a36bf3 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:55:43 +0100 Subject: [PATCH 36/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 8226cbb..965e78b 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -13,10 +13,6 @@ jobs: build-binary: name: 'Build Binary' runs-on: ubuntu-latest - - container: - image: ubuntu:24.04 - steps: - name: 'Checkout repository' uses: actions/checkout@v4 From c2ea7a80017334df0218c7c5378790d23c282eb4 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:57:54 +0100 Subject: [PATCH 37/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 965e78b..2a74678 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -26,7 +26,6 @@ jobs: run: | apt-get update apt-get install -y --no-install-recommends ninja-build g++ git ca-certificates - rm -rf /var/lib/apt/lists/* - name: 'Setup CMake' uses: jwlawson/actions-setup-cmake@v2 From 796eb219052e55a6354630a755d82d1156e1b91c Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:03:37 +0100 Subject: [PATCH 38/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 2a74678..91d975a 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -19,13 +19,11 @@ jobs: with: fetch-depth: 0 - - name: 'Install dependencies' - env: - DEBIAN_FRONTEND: noninteractive - - run: | - apt-get update - apt-get install -y --no-install-recommends ninja-build g++ git ca-certificates + - name: Set up GCC + uses: egor-tensin/setup-gcc@v2 + with: + version: '14' + platform: 'x64' - name: 'Setup CMake' uses: jwlawson/actions-setup-cmake@v2 From 48a4cdfbe13667da9dec9c5462eb26ca2af0e10e Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:08:10 +0100 Subject: [PATCH 39/44] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f56632b..9fc58ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ project( LANGUAGES CXX ) -file(WRITE "${CMAKE_BINARY_DIR}/env.sh" "export VERSION=${GIT_DESCRIBE}") +file(WRITE "${CMAKE_BINARY_DIR}/env.sh" "export VERSION=${PROJECT_VERSION}") # Set C++ standard set(CMAKE_CXX_STANDARD 23) From 20a1ee7cd3748d9b12e153c6397002e32e906f34 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:25:14 +0100 Subject: [PATCH 40/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 91d975a..c29c48b 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -22,7 +22,7 @@ jobs: - name: Set up GCC uses: egor-tensin/setup-gcc@v2 with: - version: '14' + version: '15' platform: 'x64' - name: 'Setup CMake' From 57e78a63a12a20a6b122615871adff67a2d7e97d Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:27:39 +0100 Subject: [PATCH 41/44] Update build_binary.yml --- .github/workflows/build_binary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index c29c48b..91d975a 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -22,7 +22,7 @@ jobs: - name: Set up GCC uses: egor-tensin/setup-gcc@v2 with: - version: '15' + version: '14' platform: 'x64' - name: 'Setup CMake' From 503fe12eea1537e72e6a12f606acc2fb335988f7 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:30:35 +0100 Subject: [PATCH 42/44] Update publish_jsr.yml --- .github/workflows/publish_jsr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml index 497e19d..0d1370b 100644 --- a/.github/workflows/publish_jsr.yml +++ b/.github/workflows/publish_jsr.yml @@ -40,7 +40,7 @@ jobs: with: deno-version: '2.x' - - name: 'Download artifact (binary)' + - name: 'Download artifact' uses: actions/download-artifact@v4 with: name: ${{ inputs.artifact-name }} From 27a8407b94ba145c7dbf2d9e332b01fe0ca4dd7d Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:35:03 +0100 Subject: [PATCH 43/44] Update publish_jsr.yml --- .github/workflows/publish_jsr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml index 0d1370b..9cb933a 100644 --- a/.github/workflows/publish_jsr.yml +++ b/.github/workflows/publish_jsr.yml @@ -59,7 +59,7 @@ jobs: ./jsr/bin/x86_64.json \ linux-x86_64 - - name: 'Publish package to JSR' + - name: 'Publish package to JSR (normal)' if: inputs.publish working-directory: jsr run: | From 328b1cf5a9b0e6384430ff3be200480283d33f5d Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:35:04 +0100 Subject: [PATCH 44/44] Update jsr.json --- jsr/jsr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsr/jsr.json b/jsr/jsr.json index 2e235da..1cf5fb9 100644 --- a/jsr/jsr.json +++ b/jsr/jsr.json @@ -1,7 +1,7 @@ { "name": "@serial/cpp-bindings-linux", "version": "0.1.0", - "license": "LICENSE", + "license": "./LICENSE", "description": "C++ Linux Bindings for the serial library", "exports": { "./bin": "./src/bin/index.ts"