chore(core): delete local .node files before publish (#15268)

This commit is contained in:
Jonathan Cammisuli 2023-02-25 20:54:57 -05:00 committed by GitHub
parent 0b30f1fce7
commit 24452aac70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -10,10 +10,8 @@ import { NativeFileHasher } from './native-file-hasher';
function createFileHasher(): FileHasherBase {
try {
if (
!(
process.env.NX_NON_NATIVE_HASHER &&
process.env.NX_NON_NATIVE_HASHER == 'false'
)
!process.env.NX_NON_NATIVE_HASHER ||
process.env.NX_NON_NATIVE_HASHER != 'true'
) {
return new NativeFileHasher();
}

View File

@ -72,6 +72,12 @@ function hideFromGitIndex(uncommittedFiles: string[]) {
}
if (!options.local && process.env.NPM_TOKEN) {
// Delete all .node files that were built during the previous steps
// Always run before the artifacts step because we still need the .node files for native-packages
execSync('find ./build -name "*.node" -delete', {
stdio: [0, 1, 2],
});
execSync('npx nx run-many --target=artifacts', {
stdio: [0, 1, 2],
});