Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Apr 20, 2024
1 parent b1b4c40 commit c844477
Show file tree
Hide file tree
Showing 5 changed files with 1,906 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: build
on:
push:
branches:
- master
- '*'
tags:
- '*'
pull_request:
Expand Down
35 changes: 22 additions & 13 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: prebuild
on:
push:
branches:
- master
- '*'
tags:
- '*'
pull_request:
Expand All @@ -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@v4
with:
name: ${{ matrix.name }}
path: prebuilds/*.tar.gz
path: ${{ matrix.name }}.tar.gz
retention-days: 1
release:
needs: prebuild
Expand Down
19 changes: 12 additions & 7 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,28 @@
"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": "^13.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

0 comments on commit c844477

Please sign in to comment.