Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
01f0070
feat: refactor, added documentation
Mqxx Jan 21, 2026
012a18d
fix: refactor build and publish workflows
Mqxx Jan 21, 2026
2df8bee
Update publish_jsr.yml
Mqxx Jan 22, 2026
e0f10fc
fix: renamed worflow files
Mqxx Jan 22, 2026
33c2765
fix: publish on separate branch
Mqxx Jan 22, 2026
af332b7
feat: Also publish jsr.json
Mqxx Jan 22, 2026
59810ec
feat: Refactor
Mqxx Jan 22, 2026
f2c0c36
Update build_binary.yml
Mqxx Jan 22, 2026
09d971e
Update build_binary.yml
Mqxx Jan 22, 2026
e43bf63
Update build_binary.yml
Mqxx Jan 22, 2026
e0c3d52
Update jsr.json.in
Mqxx Jan 22, 2026
25972c3
Update build_binary.yml
Mqxx Jan 22, 2026
4be407f
Update jsr.json.in
Mqxx Jan 22, 2026
df84c17
Update build_binary.yml
Mqxx Jan 22, 2026
b2d24cf
Update embed_binary.sh
Mqxx Jan 22, 2026
ad68ba2
Update embed_binary.sh
Mqxx Jan 22, 2026
ac43fe2
Update publish_jsr.yml
Mqxx Jan 22, 2026
d002eac
Update embed_binary.sh
Mqxx Jan 22, 2026
6a2c112
fix: use sh instead of txt and source it
Mqxx Jan 22, 2026
a089bc0
fix: env
Mqxx Jan 22, 2026
a298763
Update publish_jsr.yml
Mqxx Jan 22, 2026
0d82a0d
Update build_binary.yml
Mqxx Jan 22, 2026
59f8213
fix: renamed
Mqxx Jan 22, 2026
3712b9b
Update publish_jsr.yml
Mqxx Jan 22, 2026
2fcc0f6
fix: refactor varaible naming
Mqxx Jan 22, 2026
0e3be99
fix: Permissions
Mqxx Jan 22, 2026
7f3405c
fix: Permissions
Mqxx Jan 22, 2026
e4c0e89
feat: Changed version generation
Mqxx Jan 22, 2026
94007b2
Update build_binary.yml
Mqxx Jan 22, 2026
7a543cb
Update build_binary.yml
Mqxx Jan 22, 2026
18611ae
Update build_binary.yml
Mqxx Jan 22, 2026
a88b9c2
Update build_binary.yml
Mqxx Jan 22, 2026
0b6ab38
Update build_binary.yml
Mqxx Jan 22, 2026
9c5a34c
Update CMakeLists.txt
Mqxx Jan 22, 2026
2e600e6
Update build_binary.yml
Mqxx Jan 22, 2026
dc7575c
Update build_binary.yml
Mqxx Jan 22, 2026
c2ea7a8
Update build_binary.yml
Mqxx Jan 22, 2026
796eb21
Update build_binary.yml
Mqxx Jan 22, 2026
48a4cdf
Update CMakeLists.txt
Mqxx Jan 22, 2026
20a1ee7
Update build_binary.yml
Mqxx Jan 22, 2026
57e78a6
Update build_binary.yml
Mqxx Jan 22, 2026
503fe12
Update publish_jsr.yml
Mqxx Jan 22, 2026
27a8407
Update publish_jsr.yml
Mqxx Jan 22, 2026
328b1cf
Update jsr.json
Mqxx Jan 22, 2026
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
55 changes: 0 additions & 55 deletions .github/workflows/build-deno-so.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/build_binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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 ]

pull_request: {}

jobs:
build-binary:
name: 'Build Binary'
runs-on: ubuntu-latest
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up GCC
uses: egor-tensin/setup-gcc@v2
with:
version: '14'
platform: 'x64'

- name: 'Setup CMake'
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.31.x'

- name: 'Configure CMake'
env:
CXX: g++

run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release

- name: 'Build'
id: 'build'
run: |
cmake --build build --config Release

. build/env.sh
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:
name: '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

permissions:
contents: read
id-token: write
File renamed without changes.
File renamed without changes.
73 changes: 0 additions & 73 deletions .github/workflows/publish-jsr.yml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/publish_jsr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
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'
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: 'artifacts'

- name: 'Prepare files for JSR'
run: |
mkdir -p ./jsr/bin

cp ./artifacts/libcpp_bindings_linux.so ./jsr/bin/x86_64.so

./jsr/scripts/set_version.sh jsr/jsr.json "${{ inputs.version }}"

./jsr/scripts/binary_to_json.sh \
./artifacts/libcpp_bindings_linux.so \
./jsr/bin/x86_64.json \
linux-x86_64

- name: 'Publish package to JSR (normal)'
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

8 changes: 1 addition & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/package/jsr.json.in"
"${CMAKE_SOURCE_DIR}/jsr/package/jsr.json"
@ONLY
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wird die jsr.json nicht mehr gebraucht?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. That's what the version.txt gets generated for. The JSR.json.in still exists in the repository and get's replaced during the publishing.

Copy link
Member

@Katze719 Katze719 Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a script or readme on how to publish something (locally)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. 👍🏻

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the entire publishing is done using the CI. I am not sure if a "guide on how to publish locally" will be useful? Is there a specific reason why we should allow publishing an package locally? I we allow publishing packages locally, then I would need to rewrite some of the publishing steps to be sh files (that's not the problem, question is if it is even reasonable...?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not, there is a option --dry-run, so why not let devs test locally before they push to upstream?

Copy link
Member

@Katze719 Katze719 Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing in CI is a pain, and people cant push anyways without a token on local setups, but let them at least test

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I will refactor it so that you are able to publish dry locally

file(WRITE "${CMAKE_BINARY_DIR}/env.sh" "export VERSION=${PROJECT_VERSION}")

# Set C++ standard
set(CMAKE_CXX_STANDARD 23)
Expand Down
2 changes: 2 additions & 0 deletions jsr/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin/
!src/bin/
Loading