package.sh 932 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. set -e
  3. base_dir=$(
  4. cd "$(dirname "$0")"
  5. pwd
  6. )
  7. cd $base_dir
  8. cur_date="`date +%Y-%m-%d`"
  9. # Init common
  10. rm -rf ./tmp
  11. mkdir -p ./tmp/tsdb
  12. cp -rf ./include ./tmp/tsdb/
  13. cp -rf ./demo ./tmp/tsdb/
  14. cp ./README.md ./tmp/tsdb/
  15. mkdir -p ./tmp/tsdb/lib/aarch64
  16. mkdir -p ./tmp/tsdb/lib/x86-64
  17. # Build armv8
  18. ./deploy.sh -pr:h=./profiles/armv8
  19. cp ./build/deploy/lib/lib*.a ./tmp/tsdb/lib/aarch64/
  20. # Build default (x64)
  21. ./deploy.sh
  22. cp ./build/deploy/lib/lib*.a ./tmp/tsdb/lib/x86-64/
  23. # Package lf & hf versions
  24. mkdir -p ./release
  25. cd ./tmp
  26. # tar -czvf $base_dir/release/tsdb-v${cur_date}.tar.gz tsdb
  27. tar --exclude='tsdb/include/tsdb.h' --exclude='tsdb/demo/tsdbtest_lf.cpp' -czvf $base_dir/release/tsdb_hf-v${cur_date}.tar.gz tsdb
  28. tar --exclude='tsdb/include/tsdb_hf.h' --exclude='tsdb/demo/tsdbtest_hf.cpp' -czvf $base_dir/release/tsdb_lf-v${cur_date}.tar.gz tsdb
  29. cd $base_dir
  30. rm -rf ./tmp
  31. # Done!
  32. echo "✅ 打包成功"