From b7a58392166b66e15e023890cfa5eb340d8a3347 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Tue, 14 Nov 2023 18:50:04 +0200 Subject: [PATCH] Add release and publish Make targets --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e7f6070..d25f3fe 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build clean update-npmjs-readme +.PHONY: build clean update-npmjs-readme release publish build: node_modules npm run build @@ -9,6 +9,17 @@ node_modules: clean: rm -r target node_modules +release: + @read -p "Enter version bump (patch, minor, major): " bump && \ + version=$$(npm version $$bump | grep -oP "(?<=v)[^']+") && \ + echo "Version $$version created. Run 'make publish' to push the changes and publish the package." + + update-npmjs-readme: asciidoctor -b docbook -o target/README.xml README.adoc pandoc -f docbook -t markdown_strict target/README.xml -o README.md + +publish: update-npmjs-readme + @git push && \ + git push --tags && \ + npm publish