Makefile 618 B

1234567891011121314151617181920212223
  1. .PHONY: verify-tag verify-changes release
  2. default: release
  3. verify-tag:
  4. ifndef TAG
  5. $(error TAG is undefined)
  6. endif
  7. CHANGES_ERROR = $(error No CHANGES specified)
  8. verify-changes:
  9. @ (git status -sb --porcelain | \grep -E '^( M|M ) CHANGES' > /dev/null) || (echo no CHANGES specified && exit 2)
  10. release: verify-changes verify-tag
  11. @ OLD_TAG=`git describe --abbrev=0 --tags` && \
  12. npm run minify && \
  13. replace "$${OLD_TAG/v/}" "$(TAG)" -- *.min.js *.json README.md && \
  14. replace "blob/master" "blob/v$(TAG)" -- *.min.js && \
  15. git commit -m "v$(TAG)" *.js *.map *.json README.md CHANGES && \
  16. git tag "v$(TAG)"