Skip to content

Commit c0f2f62

Browse files
committed
feat: support win32-i686 platform
1 parent 1cde5f4 commit c0f2f62

File tree

20 files changed

+299
-9
lines changed

20 files changed

+299
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 91 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions/checkout@v2
2727

2828
- name: Setup node
29-
uses: actions/setup-node@v1
29+
uses: actions/setup-node@v2
3030
with:
3131
node-version: 14
3232
check-latest: true
@@ -76,6 +76,86 @@ jobs:
7676
name: bindings-${{ matrix.os }}
7777
path: packages/*/*.node
7878

79+
build-windows-i686:
80+
if: "!contains(github.event.head_commit.message, 'skip ci')"
81+
name: stable - windows-i686 - node@14
82+
runs-on: windows-latest
83+
env:
84+
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 32
85+
CARGO_PROFILE_RELEASE_LTO: 'false'
86+
steps:
87+
- uses: actions/checkout@v2
88+
89+
- name: Install node x86
90+
run: |
91+
choco install nodejs-lts --x86 -y --force
92+
refreshenv
93+
- name: Set 32bit NodeJS path
94+
run: |
95+
echo "C:\\Program Files (x86)\\nodejs" >> $GITHUB_PATH
96+
shell: bash
97+
98+
- name: NodeJS arch
99+
run: node -e "console.log(process.arch)"
100+
101+
- name: Cache NPM dependencies
102+
uses: actions/cache@v1
103+
with:
104+
path: node_modules
105+
key: npm-cache-windows-i686-node@lts-${{ hashFiles('yarn.lock') }}
106+
107+
- name: Install dependencies
108+
run: yarn install --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
109+
110+
- name: Build TypeScript
111+
run: yarn build:ts
112+
113+
- name: Install
114+
uses: actions-rs/toolchain@v1
115+
with:
116+
toolchain: stable
117+
profile: minimal
118+
override: true
119+
120+
- name: Install i686 toolchain
121+
run: rustup target add i686-pc-windows-msvc
122+
123+
- name: Generate Cargo.lock
124+
uses: actions-rs/cargo@v1
125+
with:
126+
command: generate-lockfile
127+
128+
- name: Cache cargo registry
129+
uses: actions/cache@v1
130+
with:
131+
path: ~/.cargo/registry
132+
key: stable-windows-i686-node@lts-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
133+
134+
- name: Cache cargo index
135+
uses: actions/cache@v1
136+
with:
137+
path: ~/.cargo/git
138+
key: stable-windows-i686-node@lts-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
139+
140+
- name: Cargo test
141+
uses: actions-rs/cargo@v1
142+
timeout-minutes: 5
143+
with:
144+
command: test
145+
args: -p node-rs-bcrypt --lib -- --nocapture
146+
147+
- name: Run build
148+
run: npx lerna exec "yarn build --target i686-pc-windows-msvc" --concurrency 1 --stream --no-prefix
149+
150+
- name: Test bindings
151+
run: yarn test
152+
153+
- name: Upload artifact
154+
uses: actions/upload-artifact@v2
155+
with:
156+
name: bindings-win32-i686
157+
path: packages/*/*.node
158+
79159
build-musl:
80160
if: "!contains(github.event.head_commit.message, 'skip ci')"
81161
name: stable - linux-musl - node@10
@@ -201,7 +281,7 @@ jobs:
201281
- uses: actions/checkout@v2
202282

203283
- name: Setup node
204-
uses: actions/setup-node@v1
284+
uses: actions/setup-node@v2
205285
with:
206286
node-version: 14
207287

@@ -255,7 +335,7 @@ jobs:
255335
path: packages/*/*.node
256336

257337
build-apple-silicon:
258-
name: nightly - aarch64-apple-darwin - node@14
338+
name: stable - aarch64-apple-darwin - node@14
259339
runs-on: macos-latest
260340

261341
steps:
@@ -270,7 +350,7 @@ jobs:
270350
- name: Install
271351
uses: actions-rs/toolchain@v1
272352
with:
273-
toolchain: nightly
353+
toolchain: stable
274354
profile: minimal
275355
override: true
276356

@@ -286,13 +366,13 @@ jobs:
286366
uses: actions/cache@v1
287367
with:
288368
path: ~/.cargo/registry
289-
key: nightly-apple-aarch64-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
369+
key: stable-apple-aarch64-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
290370

291371
- name: Cache cargo index
292372
uses: actions/cache@v1
293373
with:
294374
path: ~/.cargo/git
295-
key: nightly-apple-aarch64-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
375+
key: stable-apple-aarch64-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
296376

297377
- name: Cache NPM dependencies
298378
uses: actions/cache@v1
@@ -319,7 +399,7 @@ jobs:
319399
- uses: actions/checkout@v2
320400

321401
- name: Setup node
322-
uses: actions/setup-node@v1
402+
uses: actions/setup-node@v2
323403
with:
324404
node-version: 14
325405

@@ -335,13 +415,13 @@ jobs:
335415
uses: actions/cache@v1
336416
with:
337417
path: ~/.cargo/registry
338-
key: nightly-apple-aarch64-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
418+
key: stable-apple-aarch64-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
339419

340420
- name: Cache cargo index
341421
uses: actions/cache@v1
342422
with:
343423
path: ~/.cargo/git
344-
key: nightly-apple-aarch64-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
424+
key: stable-apple-aarch64-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
345425

346426
- name: Cache NPM dependencies
347427
uses: actions/cache@v1
@@ -509,6 +589,7 @@ jobs:
509589
- build-android-aarch64
510590
- build-linux-arm7
511591
- build-apple-silicon
592+
- build-windows-i686
512593
runs-on: ubuntu-latest
513594
steps:
514595
- name: auto-merge
@@ -526,6 +607,7 @@ jobs:
526607
- build-android-aarch64
527608
- build-linux-arm7
528609
- build-apple-silicon
610+
- build-windows-i686
529611
steps:
530612
- uses: actions/checkout@v2
531613

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `@node-rs/bcrypt-win32-ia32-msvc`
2+
3+
This is the **i686-pc-windows-msvc** binary for `@node-rs/bcrypt`
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@node-rs/bcrypt-win32-ia32-msvc",
3+
"version": "1.0.0",
4+
"os": ["win32"],
5+
"cpu": ["ia32"],
6+
"main": "bcrypt.win32-ia32-msvc.node",
7+
"files": ["bcrypt.win32-ia32-msvc.node"],
8+
"description": "Rust bcrypt binding",
9+
"keywords": ["bcrypt", "auth", "password", "authentication", "encryption", "crypto", "N-API", "napi-rs", "node-rs"],
10+
"author": "LongYinan <[email protected]>",
11+
"homepage": "https://github.com/napi-rs/node-rs",
12+
"license": "MIT",
13+
"engines": {
14+
"node": ">= 10"
15+
},
16+
"publishConfig": {
17+
"registry": "https://registry.npmjs.org/",
18+
"access": "public"
19+
},
20+
"repository": {
21+
"type": "git",
22+
"url": "git+https://github.com/napi-rs/node-rs.git"
23+
},
24+
"bugs": {
25+
"url": "https://github.com/napi-rs/node-rs/issues"
26+
}
27+
}

packages/bcrypt/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"triples": {
1515
"defaults": true,
1616
"additional": [
17+
"i686-pc-windows-msvc",
1718
"armv7-unknown-linux-gnueabihf",
1819
"x86_64-unknown-linux-musl",
1920
"aarch64-unknown-linux-gnu",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `@node-rs/crc32-win32-ia32-msvc`
2+
3+
This is the **i686-pc-windows-msvc** binary for `@node-rs/crc32`
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@node-rs/crc32-win32-ia32-msvc",
3+
"version": "1.0.0",
4+
"os": ["win32"],
5+
"cpu": ["ia32"],
6+
"main": "crc32.win32-ia32-msvc.node",
7+
"files": ["crc32.win32-ia32-msvc.node"],
8+
"description": "SIMD crc32",
9+
"keywords": ["SIMD", "NAPI", "napi-rs", "node-rs", "crc32", "crc32c"],
10+
"author": "LongYinan <[email protected]>",
11+
"homepage": "https://github.com/napi-rs/node-rs",
12+
"license": "MIT",
13+
"engines": {
14+
"node": ">= 10"
15+
},
16+
"publishConfig": {
17+
"registry": "https://registry.npmjs.org/",
18+
"access": "public"
19+
},
20+
"repository": {
21+
"type": "git",
22+
"url": "git+https://github.com/napi-rs/node-rs.git"
23+
},
24+
"bugs": {
25+
"url": "https://github.com/napi-rs/node-rs/issues"
26+
}
27+
}

packages/crc32/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"triples": {
1515
"defaults": true,
1616
"additional": [
17+
"i686-pc-windows-msvc",
1718
"armv7-unknown-linux-gnueabihf",
1819
"x86_64-unknown-linux-musl",
1920
"aarch64-unknown-linux-gnu",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `@node-rs/deno-lint-win32-ia32-msvc`
2+
3+
This is the **i686-pc-windows-msvc** binary for `@node-rs/deno-lint`
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@node-rs/deno-lint-win32-ia32-msvc",
3+
"version": "1.0.0",
4+
"os": ["win32"],
5+
"cpu": ["ia32"],
6+
"main": "deno-lint.win32-ia32-msvc.node",
7+
"files": ["deno-lint.win32-ia32-msvc.node"],
8+
"description": "Deno lint binding for NodeJS",
9+
"keywords": ["Deno", "Lint", "ESLint", "node-rs", "napi", "N-API", "Rust", "napi-rs"],
10+
"author": "LongYinan <[email protected]>",
11+
"homepage": "https://github.com/napi-rs/node-rs",
12+
"license": "MIT",
13+
"engines": {
14+
"node": ">= 10"
15+
},
16+
"publishConfig": {
17+
"registry": "https://registry.npmjs.org/",
18+
"access": "public"
19+
},
20+
"repository": {
21+
"type": "git",
22+
"url": "git+https://github.com/napi-rs/node-rs.git"
23+
},
24+
"bugs": {
25+
"url": "https://github.com/napi-rs/node-rs/issues"
26+
}
27+
}

packages/deno-lint/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"triples": {
1818
"defaults": true,
1919
"additional": [
20+
"i686-pc-windows-msvc",
2021
"armv7-unknown-linux-gnueabihf",
2122
"x86_64-unknown-linux-musl",
2223
"aarch64-unknown-linux-gnu",

0 commit comments

Comments
 (0)