-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1638 from kuzudb/nodejs-win-fix
Node.js build for Windows
- Loading branch information
Showing
8 changed files
with
97 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build-Windows-NodeJS-Module | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-windows-nodejs: | ||
runs-on: self-hosted-windows | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Create Node.js source distribution | ||
working-directory: tools/nodejs_api | ||
run: | | ||
node clean | ||
node package | ||
- name: Extract tarball | ||
working-directory: tools/nodejs_api | ||
run: tar -xvzf kuzu-source.tar.gz | ||
|
||
- name: Build Node.js native module | ||
working-directory: tools/nodejs_api/package | ||
shell: cmd | ||
run: | | ||
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" | ||
npm i | ||
- name: Move Node.js native module | ||
working-directory: tools/nodejs_api/package | ||
run: ren kuzujs.node kuzujs-win32-x64.node | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: windows-nodejs-module | ||
path: tools/nodejs_api/package/kuzujs-win32-x64.node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.idea/ | ||
.vscode | ||
.vs | ||
bazel-* | ||
.clwb | ||
.cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const { execSync } = require("child_process"); | ||
|
||
const SRC_PATH = path.resolve(__dirname, "../.."); | ||
const THREADS = require("os").cpus().length; | ||
|
||
console.log(`Using ${THREADS} threads to build Kuzu.`); | ||
|
||
execSync("npm run clean", { stdio: "inherit" }); | ||
execSync(`make nodejs NUM_THREADS=${THREADS}`, { | ||
cwd: SRC_PATH, | ||
stdio: "inherit", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
const IS_CLEAN_ALL = process.argv[2] === "all"; | ||
|
||
const BUILD_DIR = path.resolve(__dirname, "build"); | ||
fs.rmSync(BUILD_DIR, { recursive: true, force: true }); | ||
console.log("build dir removed"); | ||
|
||
if (IS_CLEAN_ALL) { | ||
const NODE_MODULES_DIR = path.resolve(__dirname, "node_modules"); | ||
fs.rmSync(NODE_MODULES_DIR, { recursive: true, force: true }); | ||
console.log("node_modules dir removed"); | ||
|
||
const PACKAGE_LOCK_JSON = path.resolve(__dirname, "package-lock.json"); | ||
fs.rmSync(PACKAGE_LOCK_JSON, { force: true }); | ||
console.log("package-lock.json removed"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters