25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.8KB

  1. # Make mustaches
  2. # make a release
  3. # TODO depend on test
  4. release: args tag build-wrappers
  5. @echo Done!
  6. args:
  7. ifeq ($(version),)
  8. @echo "Usage make release version=x.y.z"
  9. else
  10. @echo "Releasing: ${version}"
  11. endif
  12. tag:
  13. # splice in version
  14. sed -i.bak -e "s|%version%|${version}|" mustache.js package.json
  15. git commit -m 'Released ${version}' mustache.js package.json
  16. # tag the version
  17. git tag ${version}
  18. # revert the version
  19. sed -i.bak -e 's|exports.version = "${version}"|exports.version = "%version%"|' mustache.js
  20. sed -i.bak -e 's|"version": "${version}"|"version": "%version%"|' package.json
  21. git commit -m 'Back to non-released version' mustache.js package.json
  22. rm *.bak
  23. build-wrappers:
  24. # from that tag:
  25. # build all wrappers / minify
  26. git checkout $(version)
  27. build/wrappers.sh $(version)
  28. mkdir wrappers/mustache-$(version)
  29. cp mustache.js wrappers/mustache-$(version)/
  30. cp package.json wrappers/mustache-$(version)/
  31. git checkout gh-pages
  32. mkdir ${version}
  33. cp -r wrappers/mustache-* $(version)/
  34. cp wrappers/mustache-$(version)/* $(version)
  35. rm -rf wrappers
  36. # update gh-pages with release links & travis
  37. # add $(version)/index.html page (from template)
  38. reldate=$(shell date)
  39. sed -e 's|%version%|$(version)|' \
  40. -e 's|%date%|$(reldate)' release-index.html > $(version)/index.html
  41. # update index.html to point to $(vesion)
  42. cat index.html.pre > index.html
  43. for release in `ls -p | grep '/'`; do relno=`echo $$release | sed -e 's|/||'`; echo "<li><a href=\"$${release}\">$${relno}</a></li>" >> index.html; done
  44. cat index.html.post >> index.html
  45. git add $(version)
  46. git commit -m 'Release $(version)' index.html $(version)
  47. git clean -fdx
  48. git checkout new-build-system
  49. # update npm
  50. # update cdnjs
  51. # make test
  52. test:
  53. rspec spec/mustache_spec.rb
  54. PHONY: test release args tag build-wrappers