work-time-calculator/Makefile

32 lines
980 B
Makefile

.PHONY: help build clean update-npmjs-readme release publish
help:
@echo "Available targets:"
@echo " - help: Show this help message"
@echo " - build: Build the project"
@echo " - clean: Remove build artifacts"
@echo " - release: Create a new release version"
@echo " - publish: Publish the new version created with the release target"
node_modules:
npm install
build: node_modules
npm run build
clean:
rm -r dist node_modules
release: build
@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 dist/README.xml README.adoc
pandoc -f docbook -t gfm dist/README.xml -o README.md
publish: update-npmjs-readme
@git push && \
git push --tags && \
npm publish --otp $$(pass otp services/npmjs.com)