Skip to content

Commit

Permalink
add hints to update-version target in makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
scholarsmate committed Oct 21, 2024
1 parent c74cd3e commit 8b1d2e6
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,20 @@ lib/$(LIBNAME): CMakeLists.txt core/CMakeLists.txt
cp _install/lib/$(LIBNAME) $@

update-version:
sed -i '' -e 's|"version": .*|"version": "$(version)",|' package.json packages/server/package.json packages/client/package.json
sed -i '' -e 's|"\@omega-edit\/server": .*|"\@omega-edit\/server": "$(version)",|' packages/client/package.json
sed -i '' -e '/project(omega_edit/{N;s|.* VERSION .*|project(omega_edit\n VERSION $(version)|;}' CMakeLists.txt
# Make sure version is set for this target
@if [ -z "$(version)" ]; then \
echo "version is not set, please run \`make update-version version=1.2.3\` where 1.2.3 is the new version"; \
exit 1; \
fi
@sed -i '' -e 's|"version": .*|"version": "$(version)",|' package.json packages/server/package.json packages/client/package.json
@sed -i '' -e 's|"\@omega-edit\/server": .*|"\@omega-edit\/server": "$(version)",|' packages/client/package.json
@sed -i '' -e '/project(omega_edit/{N;s|.* VERSION .*|project(omega_edit\n VERSION $(version)|;}' CMakeLists.txt
@echo "------------------------------------------------------------------------"
@echo "Updated version to v$(version), next steps:"
@echo "git commit -am \"v$(version) [node_publish]\""
@echo "git tag -a v$(version) -m \"v$(version)\""
@echo "git push origin main --tags"
@echo "------------------------------------------------------------------------"

clean:
rm -rf _build _install lib/$(LIBNAME)
Expand All @@ -45,3 +56,4 @@ all: lib/$(LIBNAME)
@echo $<

.default: all
.phony: all clean update-version

0 comments on commit 8b1d2e6

Please sign in to comment.