Add release and publish Make targets

This commit is contained in:
Marko Korhonen 2023-11-14 18:50:04 +02:00
parent 518d1f5605
commit b7a5839216
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890

View file

@ -1,4 +1,4 @@
.PHONY: build clean update-npmjs-readme .PHONY: build clean update-npmjs-readme release publish
build: node_modules build: node_modules
npm run build npm run build
@ -9,6 +9,17 @@ node_modules:
clean: clean:
rm -r target node_modules 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: update-npmjs-readme:
asciidoctor -b docbook -o target/README.xml README.adoc asciidoctor -b docbook -o target/README.xml README.adoc
pandoc -f docbook -t markdown_strict target/README.xml -o README.md pandoc -f docbook -t markdown_strict target/README.xml -o README.md
publish: update-npmjs-readme
@git push && \
git push --tags && \
npm publish