Skip to content

Commit 0ff77ca

Browse files
committed
ci: refactor
1 parent 1dad239 commit 0ff77ca

7 files changed

Lines changed: 35 additions & 33 deletions

File tree

.github/workflows/publish-jsr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup Deno
4141
uses: denoland/setup-deno@v2
4242
with:
43-
deno-version: "2.6.0"
43+
deno-version: "2.x"
4444

4545
- name: Configure CMake (Release)
4646
env:
@@ -54,10 +54,10 @@ jobs:
5454
5555
- name: Embed binary as JSON/base64 for JSR
5656
run: |
57-
deno run --allow-read --allow-write jsr/scripts/embed_binary.ts \
58-
--binaryPath="build/libcpp_bindings_linux.so" \
59-
--target="linux-x86_64"
60-
57+
./jsr/scripts/embed_binary.sh \
58+
build/libcpp_bindings_linux.so \
59+
linux-x86_64
60+
6161
- name: Publish package to JSR (real)
6262
if: github.ref_name == 'main' || startsWith(github.ref, 'refs/tags/')
6363
working-directory: jsr

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ project(
2626
# Generate JSR package metadata from the same git-derived version as the library.
2727
# We generate into the build directory to avoid touching tracked files during normal local builds.
2828
configure_file(
29-
"${CMAKE_SOURCE_DIR}/jsr/jsr.json.in"
30-
"${CMAKE_SOURCE_DIR}/jsr/jsr.json"
29+
"${CMAKE_SOURCE_DIR}/jsr/package/jsr.json.in"
30+
"${CMAKE_SOURCE_DIR}/jsr/package/jsr.json"
3131
@ONLY
3232
)
3333

File renamed without changes.
File renamed without changes.
File renamed without changes.

jsr/scripts/embed_binary.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
BINARY_PATH="$1"
5+
TARGET="$2"
6+
7+
if [ -z "${BINARY_PATH:-}" ] || [ -z "${TARGET:-}" ]; then
8+
echo "Usage: $0 <binaryPath> <target>" >&2
9+
exit 1
10+
fi
11+
12+
JSR_BIN_PATH="./jsr/package/bin"
13+
14+
mkdir -p "$JSR_BIN_PATH"
15+
16+
cp "$BINARY_PATH" "$JSR_BIN_PATH/x84_64.so"
17+
18+
# base64 without linebreak (GNU + BSD kompatibel)
19+
BASE64_DATA="$(base64 "$BINARY_PATH" | tr -d '\n')"
20+
21+
cat > "$JSR_BIN_PATH/x84_64.json" <<EOF
22+
{
23+
"target": "$TARGET",
24+
"filename": "$BINARY_PATH",
25+
"encoding": "base64",
26+
"data": "$BASE64_DATA"
27+
}
28+
EOF

jsr/scripts/embed_binary.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)