Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebuildify #133

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,30 @@ jobs:
fail-fast: false
matrix:
include:
- name: darwin-x64
os: macos-latest
- name: darwin
os: macos-11
node: x64
- name: darwin-arm64
os: macos-latest
node: x64
args: --arch arm64
command: prebuild --arch x64+arm64
- name: win32-x86
os: windows-latest
os: windows-2019
node: x86
command: prebuild
- name: win32-x64
os: windows-latest
os: windows-2019
node: x64
command: prebuild
- name: linux-x64
os: ubuntu-latest
node: x64
os: ubuntu-20.04
command: prebuild-cross --tag-libc -i centos7-devtoolset7 -i alpine
- name: linux-arm
os: ubuntu-20.04
command: prebuild-cross --tag-armv -i linux-arm64 -i linux-armv7 -i linux-armv6
- name: android-arm
os: ubuntu-20.04
command: prebuild-cross --tag-armv -i android-arm64 -i android-armv7
- name: linux-x86
os: ubuntu-20.04
command: prebuild-cross -i linux-x86
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -55,11 +63,12 @@ jobs:
- if: contains(matrix.os, 'windows')
uses: microsoft/[email protected]
- run: yarn install --ignore-scripts
- run: yarn prebuild ${{ matrix.args }}
- run: yarn ${{ matrix.command }}
- run: tar -zcvf ${{ matrix.name }}.tar.gz -C prebuilds .
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}
path: prebuilds/*.tar.gz
path: ${{ matrix.name }}.tar.gz
retention-days: 1
release:
needs: prebuild
Expand Down
20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"bluetooth"
],
"scripts": {
"install": "prebuild-install --backend cmake-js --runtime napi || cmake-js rebuild",
"rebuild": "cmake-js rebuild",
"clean": "yarn clean:cpp && yarn clean:ts",
"clean:cpp": "cmake-js clean && git clean -fx ./prebuilds",
"clean:ts": "git clean -fx ./dist ./docs",
Expand All @@ -29,23 +29,27 @@
"watch": "tsc -w --preserveWatchOutput",
"lint": "eslint . --ext .ts",
"test": "mocha --timeout 10000 test/*.test.js",
"prebuild": "prebuild --backend cmake-js --runtime napi --all --strip --verbose",
"docs": "typedoc"
"docs": "typedoc",
"prebuild": "prebuildify --backend cmake-js --napi --strip",
"prebuild-cross": "prebuildify-cross --backend cmake-js --napi --strip",
"prepublishOnly": "prebuildify-ci download",
"prebuild-download": "prebuildify-ci download"
},
"dependencies": {
"bindings": "^1.5.0",
"cmake-js": "^7.0.0",
"node-addon-api": "^7.0.0",
"prebuild-install": "^7.1.1"
"node-gyp-build": "^4.5.0"
},
"devDependencies": {
"@types/node": "^20.2.5",
"@types/web-bluetooth": "^0.0.20",
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"cmake-js": "^7.0.0",
"eslint": "^8.29.0",
"mocha": "^10.2.0",
"prebuild": "^12.0.0",
"node-addon-api": "^7.0.0",
"prebuildify": "thegecko/prebuildify#cmake-js",
"prebuildify-ci": "^1.0.5",
"prebuildify-cross": "^5.0.0",
"typedoc": "^0.25.1",
"typescript": "^4.9.4"
},
Expand Down
4 changes: 3 additions & 1 deletion src/adapters/simpleble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
* SOFTWARE.
*/

import { join } from 'path';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const simpleble = require('bindings')('simpleble.node');
const simpleble = require('node-gyp-build')(join(__dirname, '..', '..'));
module.exports = simpleble;

/** SimpleBLE address type. */
Expand Down
Loading
Loading