build.sh 495 B

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