Skip to content

Commit

Permalink
Release version 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dilantha committed Dec 6, 2024
1 parent ee53a3c commit 7d38c80
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 22 deletions.
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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"
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
9 changes: 1 addition & 8 deletions bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "link-formatter",
"version": "1.0.1",
"version": "1.0.2",
"description": "",
"main": "main.js",
"scripts": {
Expand Down
18 changes: 18 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 7d38c80

Please sign in to comment.