Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 45 lines 2.2 kB view raw
1diff --git a/pack.ts b/pack.ts 2index 0212d09..03ce86a 100644 3--- a/pack.ts 4+++ b/pack.ts 5@@ -75,39 +75,7 @@ const packageApp = async () => { 6 delete pJson.scripts.prepack; // We don't want to rebuild - all built code will be in the packed content 7 await fs.writeJson(path.join(OUTPUT_DIR, 'package.json'), pJson); 8 9- const buildScript = path.join(OUTPUT_DIR, 'build-release.sh'); 10- 11- // Run build-release in this folder, for each platform. For each bundle, we copy in 12- // only the relevant platform-specific NSS files. 13- console.log('Building for Linux x64'); 14- await fs.mkdir(path.join(OUTPUT_DIR, 'nss')); 15- await fs.copy(path.join(__dirname, 'nss', 'linux'), path.join(OUTPUT_DIR, 'nss', 'linux')); 16- await spawn(buildScript, ['linux', 'x64'], { cwd: OUTPUT_DIR, stdio: 'inherit' }); 17- 18- console.log('Building for Linux arm64'); 19- await spawn(buildScript, ['linux', 'arm64'], { cwd: OUTPUT_DIR, stdio: 'inherit' }); 20- 21- console.log('Building for Darwin x64'); 22- await fs.remove(path.join(OUTPUT_DIR, 'nss', 'linux')); 23- await fs.copy(path.join(__dirname, 'nss', 'darwin'), path.join(OUTPUT_DIR, 'nss', 'darwin')); 24- await spawn(buildScript, ['darwin', 'x64'], { cwd: OUTPUT_DIR, stdio: 'inherit' }); 25- 26- console.log('Building for Darwin arm64'); 27- await spawn(buildScript, ['darwin', 'arm64'], { cwd: OUTPUT_DIR, stdio: 'inherit' }); 28- 29- console.log('Building for Win32'); 30- await fs.remove(path.join(OUTPUT_DIR, 'nss', 'darwin')); 31- await fs.copy(path.join(__dirname, 'nss', 'win32'), path.join(OUTPUT_DIR, 'nss', 'win32')); 32- await spawn(buildScript, ['win32', 'x64'], { cwd: OUTPUT_DIR, stdio: 'inherit' }); 33- 34- // Oclif builds a nodeless platform-agnostic bundle too (although in our case, nothing is 35- // really platform agnostic). Not necessary, probably won't work - drop it. 36- await fs.remove(path.join( 37- OUTPUT_DIR, 38- 'dist', 39- `v${pJson.version}`, 40- `httptoolkit-server-v${pJson.version}.tar.gz` 41- )); 42+ await spawn('npm', ['exec', '--', 'oclif-dev', 'pack', '--targets=linux-x64'], { cwd: OUTPUT_DIR, stdio: 'inherit' }); 43 } 44 45 packageApp().catch(e => {