commit 65cc193167f84f76e6bb57e1b6dc20d15ec68ce9
parent 0278a52404f4636256e45577beaf031ab6d1d2de
Author: MTRNord <mtrnord1@gmail.com>
Date: Sun, 1 Oct 2023 20:26:26 +0200
Try getting windows to build
Diffstat:
5 files changed, 48 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
@@ -34,6 +34,9 @@ jobs:
brew install pkg-config
make build
strip -x *.node
+ - host: windows-latest
+ build: yarn build
+ target: x86_64-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
build: |-
@@ -93,9 +96,21 @@ jobs:
- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
+ - name: Setup node x86
+ if: matrix.settings.target == 'i686-pc-windows-msvc'
+ run: yarn config set supportedArchitectures.cpu "ia32"
+ shell: bash
shell: bash
- name: Install dependencies
run: yarn install
+ - name: Setup node x86
+ uses: actions/setup-node@v3
+ if: matrix.settings.target == 'i686-pc-windows-msvc'
+ with:
+ node-version: 18
+ check-latest: true
+ cache: yarn
+ architecture: x86
- name: Build
run: ${{ matrix.settings.build }}
shell: bash
@@ -105,7 +120,7 @@ jobs:
name: bindings-${{ matrix.settings.target }}
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error
- test-macOS-binding:
+ test-macOS-windows-binding:
name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }}
needs:
- build
@@ -115,6 +130,8 @@ jobs:
settings:
- host: macos-latest
target: x86_64-apple-darwin
+ - host: windows-latest
+ target: x86_64-pc-windows-msvc
node:
- '14'
- '16'
@@ -215,7 +232,7 @@ jobs:
name: Publish
runs-on: ubuntu-latest
needs:
- - test-macOS-binding
+ - test-macOS-windows-binding
- test-linux-x64-gnu-binding
- test-linux-aarch64-gnu-binding
steps:
diff --git a/Cargo.toml b/Cargo.toml
@@ -15,6 +15,9 @@ napi = { version = "2.12.2", default-features = false, features = [
napi-derive = "2.12.2"
yara = { version = "0.21.0", features = ["yara-static"] }
+[target.x86_64-pc-windows-msvc.dependencies]
+yara = { version = "0.21.0", features = ["yara-static", "vendored"] }
+
[build-dependencies]
napi-build = "2.0.1"
diff --git a/npm/win32-x64-msvc/README.md b/npm/win32-x64-msvc/README.md
@@ -0,0 +1,3 @@
+# `@node_yara_rs/node-yara-rs-win32-x64-msvc`
+
+This is the **x86_64-pc-windows-msvc** binary for `@node_yara_rs/node-yara-rs`
diff --git a/npm/win32-x64-msvc/package.json b/npm/win32-x64-msvc/package.json
@@ -0,0 +1,19 @@
+{
+ "name": "@node_yara_rs/node-yara-rs-win32-x64-msvc",
+ "version": "0.2.1",
+ "os": [
+ "win32"
+ ],
+ "cpu": [
+ "x64"
+ ],
+ "main": "node-yara-rs.win32-x64-msvc.node",
+ "files": [
+ "node-yara-rs.win32-x64-msvc.node"
+ ],
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">= 18"
+ },
+ "repository": "https://github.com/MTRNord/node-yara-rs.git"
+}
+\ No newline at end of file
diff --git a/package.json b/package.json
@@ -6,12 +6,9 @@
"napi": {
"name": "node-yara-rs",
"triples": {
- "defaults": false,
"additional": [
"aarch64-apple-darwin",
- "aarch64-unknown-linux-gnu",
- "x86_64-apple-darwin",
- "x86_64-unknown-linux-gnu"
+ "aarch64-unknown-linux-gnu"
]
}
},
@@ -38,4 +35,4 @@
},
"packageManager": "yarn@3.6.3",
"repository": "https://github.com/MTRNord/node-yara-rs.git"
-}
+}
+\ No newline at end of file