Skip to content

Commit

Permalink
feat(core): add targets and change file name
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammisuli authored and FrozenPandaz committed Jan 30, 2023
1 parent 6074d6e commit 666323f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
- host: macos-latest
target: x86_64-apple-darwin
build: |
npx nx run-many --target=build-native
npx nx run-many --target=build-native --target=x86_64-apple-darwin
strip -x packages/**/*.node
- host: windows-latest
build: npx nx run-many --target=build-native
build: npx nx run-many --target=build-native -- --target=x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
- host: windows-latest
build: |
Expand All @@ -36,7 +36,7 @@ jobs:
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: set -e && npx nx run-many --target=build-native && strip *.node
build: set -e && npx nx run-many --target=build-native -- --target=x86_64-unknown-linux-musl && strip *.node
- host: macos-latest
target: aarch64-apple-darwin
build: |
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
env
freebsd-version
yarn install
npx nx run-many --target=build-native
npx nx run-many --target=build-native -- --target=x86_64-unknown-freebsd
strip -x packages/**/*.node
rm -rf node_modules
rm -rf target
Expand Down
6 changes: 5 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@
"!{projectRoot}/.storybook/**/*",
"!{projectRoot}/**/*.stories.@(js|jsx|ts|tsx|mdx)"
],
"sharedGlobals": ["{workspaceRoot}/babel.config.json"]
"sharedGlobals": ["{workspaceRoot}/babel.config.json"],
"rustCode": ["{projectRoot}/**/*.rs", "{projectRoot}/**/Cargo.*"]
},
"targetDefaults": {
"build": {
"dependsOn": ["build-base"],
"inputs": ["production", "^production"]
},
"build-native": {
"inputs": ["rustCode"]
},
"build-base": {
"dependsOn": ["^build-base", "build-native"],
"inputs": ["production", "^production"],
Expand Down
1 change: 1 addition & 0 deletions packages/nx/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"implicitDependencies": ["graph-client"],
"targets": {
"build-native": {
"outputs": ["{projectRoot}/src/native/*.node"],
"executor": "@monodon/rust:napi",
"options": {
"dist": "packages/nx/src/native",
Expand Down

0 comments on commit 666323f

Please sign in to comment.