diff --git a/Makefile b/Makefile index 437c5d5..ca137f7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: install build test clean release-major release-minor release-patch +.PHONY: install build test clean bump-major bump-minor bump-patch release # Default target all: install build test @@ -19,16 +19,20 @@ test: clean: rm -rf main.js main.js.map -# Release targets -release-major: clean install build test +# Version bump targets +bump-major: clean install build test ./bump-version.sh major -release-minor: clean install build test +bump-minor: clean install build test ./bump-version.sh minor -release-patch: clean install build test +bump-patch: clean install build test ./bump-version.sh patch +# Release target +release: + ./release.sh + # Development mode dev: pnpm run dev @@ -41,8 +45,9 @@ help: @echo " make test - Run tests" @echo " make clean - Clean build artifacts" @echo " make dev - Run in development mode" - @echo " make release-major - Release major version" - @echo " make release-minor - Release minor version" - @echo " make release-patch - Release patch version" + @echo " make bump-major - Bump major version" + @echo " make bump-minor - Bump minor version" + @echo " make bump-patch - Bump patch version" + @echo " make release - Release the current version" @echo " make all - Install, build, and test" @echo " make help - Show this help message" diff --git a/README.md b/README.md index 3921234..894736a 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,11 @@ This plugin uses a Makefile to streamline development tasks. Here are the availa - `make clean` - Clean build artifacts - `make all` - Run install, build, and test in sequence -For releases: -- `make release-major` - Release a major version -- `make release-minor` - Release a minor version -- `make release-patch` - Release a patch version +For version management and releases: +- `make bump-major` - Bump major version number +- `make bump-minor` - Bump minor version number +- `make bump-patch` - Bump patch version number +- `make release` - Release the current version (create git tag and push) > [Link to plugin](https://github.com/dilantha/obsidian-link-formatter) > [Buy me a coffee](https://buymeacoffee.com/dilantha) diff --git a/bump-version.sh b/bump-version.sh index 46e9e5e..72fb9f5 100755 --- a/bump-version.sh +++ b/bump-version.sh @@ -50,11 +50,4 @@ sed -i '' "s/\"version\": \"$current_version\"/\"version\": \"$new_version\"/" p # Update manifest.json sed -i '' "s/\"version\": \"$current_version\"/\"version\": \"$new_version\"/" manifest.json -# Git operations -git add package.json manifest.json -git commit -m "chore: bump version to $new_version" -git tag "v$new_version" -git push origin main -git push origin "v$new_version" - -echo "Successfully bumped version to $new_version and pushed changes" +echo "$new_version" diff --git a/manifest.json b/manifest.json index a95f705..885562c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "link-formatter", "name": "Link Formatter", - "version": "1.0.1", + "version": "1.0.2", "minAppVersion": "0.15.0", "description": "Formats a block of links into a clean markdown list", "author": "Dilantha Nanayakkara", diff --git a/package.json b/package.json index f5311fc..64ab873 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "link-formatter", - "version": "1.0.1", + "version": "1.0.2", "description": "", "main": "main.js", "scripts": { diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..171e8e4 --- /dev/null +++ b/release.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Get version from manifest.json +version=$(grep '"version":' manifest.json | cut -d'"' -f4) + +if [ -z "$version" ]; then + echo "Error: Could not get version from manifest.json" + exit 1 +fi + +# Git operations +git add . +git commit -m "Release version $version" +git tag "v$version" +git push origin main +git push origin "v$version" + +echo "Successfully released version $version and pushed changes"