diff --git a/.github/npm.yml b/.github/npm.yml new file mode 100644 index 00000000..f23b8eb2 --- /dev/null +++ b/.github/npm.yml @@ -0,0 +1,51 @@ +name: +on: + workflow_call: +env: + SDK_JS_HOME: cohort_sdk_js +jobs: + npm: + strategy: + matrix: + settings: + - host: macos-latest + target: darwin-arm64 + buildCommand: | + cd $SDK_JS_HOME && npm run build -- --target darwin-arm64 + name: stable - ${{ matrix.settings.target }} - node@16 + runs-on: ${{ matrix.settings.host }} + steps: + - uses: actions/checkout@v3 + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + check-latest: true + + - name: Install + uses: actions-rs/toolchain@v1 + with: + profile: minimal + override: true + toolchain: stable + target: ${{ matrix.settings.target }} + + - name: List content before build + shell: bash + run: ls -l + + # - name: Cache cargo TODO deal with caching + - name: Install node dependencies + run: cd $SDK_JS_HOME && npm install + + - name: Cargo build + run: cargo build + + - name: Build + shell: bash + run: ${{ matrix.settings.buildCommand }} + + - name: List content after build + shell: bash + run: ls -l \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f71ac068..0f2a233e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,4 +15,4 @@ jobs: - run: rustup component add rustfmt clippy - name: cargo build run: cargo build --release - - run: scripts/pre-commit-checks.sh + - run: scripts/pre-commit-checks.sh \ No newline at end of file diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 7b117f8c..3a05fba8 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -10,6 +10,8 @@ jobs: uses: ./.github/workflows/build.yml coverage: uses: ./.github/workflows/coverage.yml + coverage: + uses: ./.github/workflows/npm.yml diff --git a/packages/cohort_sdk_js/npm/darwin-arm64/package.json b/packages/cohort_sdk_js/npm/darwin-arm64/package.json new file mode 100644 index 00000000..f99e721e --- /dev/null +++ b/packages/cohort_sdk_js/npm/darwin-arm64/package.json @@ -0,0 +1,18 @@ +{ + "name": "cohort_sdk_js-darwin-arm64", + "version": "0.0.1", + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ], + "main": "cohort_sdk_js.darwin-arm64.node", + "files": [ + "cohort_sdk_js.darwin-arm64.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} \ No newline at end of file diff --git a/packages/cohort_sdk_js/npm/darwin-universal/package.json b/packages/cohort_sdk_js/npm/darwin-universal/package.json new file mode 100644 index 00000000..cfbcc6df --- /dev/null +++ b/packages/cohort_sdk_js/npm/darwin-universal/package.json @@ -0,0 +1,15 @@ +{ + "name": "cohort_sdk_js-darwin-universal", + "version": "0.0.1", + "os": [ + "darwin" + ], + "main": "cohort_sdk_js.darwin-universal.node", + "files": [ + "cohort_sdk_js.darwin-universal.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} \ No newline at end of file diff --git a/packages/cohort_sdk_js/npm/darwin-x64/package.json b/packages/cohort_sdk_js/npm/darwin-x64/package.json new file mode 100644 index 00000000..1cb175b4 --- /dev/null +++ b/packages/cohort_sdk_js/npm/darwin-x64/package.json @@ -0,0 +1,18 @@ +{ + "name": "cohort_sdk_js-darwin-x64", + "version": "0.0.1", + "os": [ + "darwin" + ], + "cpu": [ + "x64" + ], + "main": "cohort_sdk_js.darwin-x64.node", + "files": [ + "cohort_sdk_js.darwin-x64.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} \ No newline at end of file diff --git a/packages/cohort_sdk_js/npm/linux-x64-gnu/package.json b/packages/cohort_sdk_js/npm/linux-x64-gnu/package.json new file mode 100644 index 00000000..4c131e23 --- /dev/null +++ b/packages/cohort_sdk_js/npm/linux-x64-gnu/package.json @@ -0,0 +1,18 @@ +{ + "name": "cohort_sdk_js-linux-x64", + "version": "0.0.1", + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "main": "cohort_sdk_js.linux-x64.node", + "files": [ + "cohort_sdk_js.linux-x64.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} \ No newline at end of file diff --git a/packages/cohort_sdk_js/npm/win32-x64-msvc/package.json b/packages/cohort_sdk_js/npm/win32-x64-msvc/package.json new file mode 100644 index 00000000..480ce6c6 --- /dev/null +++ b/packages/cohort_sdk_js/npm/win32-x64-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "cohort_sdk_js-win32-x64-msvc", + "version": "0.0.1", + "os": [ + "win32" + ], + "cpu": [ + "x64" + ], + "main": "cohort_sdk_js.win32-x64-msvc.node", + "files": [ + "cohort_sdk_js.win32-x64-msvc.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} \ No newline at end of file diff --git a/packages/cohort_sdk_js/package.json b/packages/cohort_sdk_js/package.json index a6d8a2de..f0aaa3ce 100644 --- a/packages/cohort_sdk_js/package.json +++ b/packages/cohort_sdk_js/package.json @@ -1,6 +1,6 @@ { "name": "cohort_sdk_js", - "version": "0.1.13", + "version": "0.0.1", "main": "index.js", "types": "index.d.ts", "napi": { @@ -26,7 +26,7 @@ "node": ">= 10" }, "scripts": { - "artifacts": "napi artifacts", + "artifacts": "napi artifacts -d .", "build": "napi build --platform --release", "build:debug": "napi build --platform", "test": "ava", @@ -42,4 +42,4 @@ "cohort_sdk_js-darwin-arm64": "0.0.1", "cohort_sdk_js-darwin-universal": "0.0.1" } -} +} \ No newline at end of file