Add publish target

This commit is contained in:
Johan Nordberg
2021-03-24 08:32:03 +09:00
parent 36426d03a1
commit f20b7d5027
+7
View File
@@ -27,6 +27,13 @@ ci-lint: node_modules
node_modules: node_modules:
yarn install --non-interactive --frozen-lockfile --ignore-scripts yarn install --non-interactive --frozen-lockfile --ignore-scripts
.PHONY: publish
publish: | distclean node_modules
@git diff-index --quiet HEAD || (echo "Uncommitted changes, please commit first" && exit 1)
@git fetch origin && git diff origin/master --quiet || (echo "Changes not pushed to origin, please push first" && exit 1)
@yarn config set version-tag-prefix "" && yarn config set version-git-message "Version %s"
@yarn publish && git push && git push --tags
.PHONY: clean .PHONY: clean
clean: clean:
rm -rf lib/ coverage/ rm -rf lib/ coverage/