Skip to content

Commit 55b0e30

Browse files
committed
feat: integrate node-module and update release pipeline
1 parent 50e18a4 commit 55b0e30

6 files changed

Lines changed: 50 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,29 @@ jobs:
4646
override: true
4747

4848
- name: Compile Production Binaries
49-
run: cargo build --release --workspace --target ${{ matrix.target }}
49+
run: |
50+
cargo build --release --workspace --target ${{ matrix.target }}
51+
cd node-module && npm install && npm run build
5052
5153
- name: Stage Assets for Upload
5254
shell: bash
5355
run: |
5456
mkdir staging
5557
# Define binaries
56-
CLI_BIN="gpupatch-cli"
57-
GUI_BIN="gpupatch-gui"
58+
CLI_BIN="gpupatch"
59+
GUI_BIN="companion"
5860
EXT=""
5961
if [ "${{ matrix.os }}" = "windows-latest" ]; then
6062
EXT=".exe"
6163
fi
62-
64+
6365
# Copy binaries
6466
cp target/${{ matrix.target }}/release/${CLI_BIN}${EXT} ./staging/${CLI_BIN}-${{ matrix.target }}${EXT}
6567
cp target/${{ matrix.target }}/release/${GUI_BIN}${EXT} ./staging/${GUI_BIN}-${{ matrix.target }}${EXT}
66-
68+
69+
# Copy Node module
70+
cp node-module/*.node ./staging/gpupatch-node-${{ matrix.target }}.node
71+
6772
if [ "${{ matrix.os }}" != "windows-latest" ]; then
6873
chmod +x ./staging/*
6974
fi

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ resolver = "2"
33
members = [
44
"core",
55
"cli",
6-
"gui",
6+
"gui", "node-module",
77
]

node-module/Cargo.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "gpupatch-node"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[lib]
7+
crate-type = ["cdylib"]
8+
9+
[dependencies]
10+
napi = { version = "2.16.0", features = ["napi4"] }
11+
napi-derive = "2.16.0"
12+
gpupatch-core = { path = "../core" }
13+
14+
[build-dependencies]
15+
napi-build = "2.1.0"

node-module/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
napi_build::setup();
3+
}

node-module/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "gpupatch-node",
3+
"version": "0.1.0",
4+
"main": "index.js",
5+
"types": "index.d.ts",
6+
"devDependencies": {
7+
"@napi-rs/cli": "^3.0.0"
8+
},
9+
"scripts": {
10+
"build": "napi build --platform --release"
11+
}
12+
}

node-module/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#[macro_use]
2+
extern crate napi_derive;
3+
4+
use napi::bindgen_prelude::*;
5+
6+
#[napi]
7+
pub fn hello_from_gpupatch() -> String {
8+
"Hello from GPUPatch core!".to_owned()
9+
}

0 commit comments

Comments
 (0)