build.sh 518 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env bash
  2. set -ex
  3. ## remove build directory
  4. rm -rf build
  5. ## build for both 32 and 64bit
  6. pkg --out-path build package.json --targets \
  7. node10-linux-x86,node10-linux-x64,\
  8. node10-alpine-x64,\
  9. node10-win-x86,node10-win-x64,\
  10. node10-macos-x86,node10-macos-x64
  11. ## archive builds
  12. cd build
  13. for file in *; do
  14. du -sh $file
  15. if [[ $file == *".exe"* ]]; then
  16. mv $file d-fi.exe
  17. zip ${file%.*}.zip d-fi.exe
  18. rm d-fi.exe
  19. else
  20. mv $file d-fi
  21. zip ${file%.*}.zip d-fi
  22. rm d-fi
  23. fi
  24. done
  25. du -sh *