release.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. VERSION="$1"
  3. if [ -z "$VERSION" ]; then
  4. echo "Version required."
  5. exit
  6. else
  7. echo "Releasing $VERSION"
  8. fi
  9. rm -r .release
  10. rm -r dist
  11. mkdir .release
  12. mkdir .release/quill
  13. npm run build
  14. npx webpack --env minimize
  15. cp dist/quill.core.css dist/quill.bubble.css dist/quill.snow.css dist/quill.js dist/quill.core.js dist/quill.min.js dist/quill.min.js.map .release/quill/
  16. cd .release
  17. # tar -czf quill.tar.gz quill
  18. aws s3 cp quill/quill.js s3://cdn.quilljs.com/$VERSION/ --cache-control max-age=604800 --content-type "application/javascript; charset=utf-8" --profile quill
  19. aws s3 cp quill/quill.min.js s3://cdn.quilljs.com/$VERSION/ --cache-control max-age=604800 --content-type "application/javascript; charset=utf-8" --profile quill
  20. aws s3 cp quill/quill.core.js s3://cdn.quilljs.com/$VERSION/ --cache-control max-age=604800 --content-type "application/javascript; charset=utf-8" --profile quill
  21. aws s3 cp quill/quill.bubble.css s3://cdn.quilljs.com/$VERSION/ --cache-control max-age=604800 --content-type "text/css; charset=utf-8" --profile quill
  22. aws s3 cp quill/quill.core.css s3://cdn.quilljs.com/$VERSION/ --cache-control max-age=604800 --content-type "text/css; charset=utf-8" --profile quill
  23. aws s3 cp quill/quill.snow.css s3://cdn.quilljs.com/$VERSION/ --cache-control max-age=604800 --content-type "text/css; charset=utf-8" --profile quill
  24. aws s3 cp quill/quill.min.js.map s3://cdn.quilljs.com/$VERSION/ --cache-control max-age=604800 --content-type "application/json; charset=utf-8" --profile quill
  25. aws s3 sync s3://cdn.quilljs.com/$VERSION/ s3://cdn.quilljs.com/latest/ --profile quill
  26. cd ..
  27. # git tag v$VERSION -m "Version $VERSION"
  28. # git push origin v$VERSION
  29. # git push origin master
  30. npm publish --tag dev