diff --git a/scripts/publish-npm.ts b/scripts/publish-npm.ts index 390eb58466b..c98828d93bd 100755 --- a/scripts/publish-npm.ts +++ b/scripts/publish-npm.ts @@ -112,6 +112,11 @@ async function main() { console.log(chalk.magenta.bold(`~~~ Preparing package ${pkg}~~~`)); console.log(chalk.magenta('~~~ Installing packages ~~~')); + // tfjs-node-gpu needs to get some files from tfjs-node. + if (pkg === "tfjs-node-gpu") { + $('yarn prep-gpu'); + } + // Yarn above the other checks to make sure yarn doesn't change the lock file. $('yarn'); diff --git a/scripts/release-util.ts b/scripts/release-util.ts index dd607ed207f..893fffff5fd 100755 --- a/scripts/release-util.ts +++ b/scripts/release-util.ts @@ -46,9 +46,12 @@ export const UNION_PHASE: Phase = { deps: ['tfjs-core', 'tfjs-layers', 'tfjs-converter', 'tfjs-data'] }; +// We added tfjs-core and tfjs-layers because Node has unit tests that directly +// use tf.core and tf.layers to test serialization of models. Consider moving +// the test to tf.layers. export const NODE_PHASE: Phase = { packages: ['tfjs-node', 'tfjs-node-gpu'], - deps: ['tfjs', 'tfjs-core'], + deps: ['tfjs', 'tfjs-core', 'tfjs-layers'], scripts: {'tfjs-node-gpu': {'before-yarn': ['yarn prep-gpu']}} };