release.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. webpack --config _develop/webpack.config.js --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. printf "cdn: .\nversion: ." > jekyll.yml
  18. jekyll build -s ../docs -d _site --config ../docs/_config.yml,jekyll.yml
  19. mkdir quill/examples
  20. mv _site/standalone/bubble/index.html quill/examples/bubble.html
  21. mv _site/standalone/snow/index.html quill/examples/snow.html
  22. mv _site/standalone/full/index.html quill/examples/full.html
  23. find quill/examples -type f -exec sed -i "" 's/\<link rel\="icon".*\>/ /g' {} \;
  24. find quill/examples -type f -exec sed -i "" 's/href="\/\//href="https:\/\//g' {} \;
  25. find quill/examples -type f -exec sed -i "" 's/src="\/\//src="https:\/\//g' {} \;
  26. tar -czf quill.tar.gz quill
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. aws s3 sync s3://cdn.quilljs.com/$VERSION/ s3://cdn.quilljs.com/latest/ --profile quill
  35. cd ..
  36. git tag v$VERSION -m "Version $VERSION"
  37. git push origin v$VERSION
  38. git push origin master
  39. npm publish