From 789640b81850913f84c4b17ebceade326a4195a7 Mon Sep 17 00:00:00 2001 From: Calvin Young Date: Sun, 22 Mar 2026 16:29:07 -0700 Subject: [PATCH] Update commands for publishing new releases (#8) --- Makefile | 25 +++++++++++++++++++++++++ README.md | 12 ++++++++---- package.json | 1 - 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0ace6b8..4053a2f 100644 --- a/Makefile +++ b/Makefile @@ -17,3 +17,28 @@ check: .PHONY: fix fix: pnpm run fix + +# Bump the version, update manifest/versions files, and push a release branch. +# Usage: make bump-version TYPE=patch|minor|major +.PHONY: bump-version +bump-version: +ifndef TYPE + $(error TYPE is required. Usage: make bump-version TYPE=patch|minor|major) +endif + pnpm version $(TYPE) --no-git-tag-version + $(eval VERSION := $(shell node -p "require('./package.json').version")) + npm_package_version=$(VERSION) node version-bump.mjs + git checkout -b release/$(VERSION) + git add package.json manifest.json versions.json + git commit -m "$(VERSION)" + git push -u origin release/$(VERSION) + +# Tag the current version on main and push it to trigger the release workflow. +# Run this after the bump-version PR has been merged. +.PHONY: release-tag +release-tag: + git checkout main + git pull origin main + $(eval VERSION := $(shell node -p "require('./package.json').version")) + git tag $(VERSION) + git push origin $(VERSION) diff --git a/README.md b/README.md index f22dd8b..713bc6a 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,13 @@ repository](https://obsidian.md/plugins?id=backlink-settings). ### Publishing -1. `pnpm version ` — bumps `version` in package.json, updates manifest.json and versions.json, and creates a git commit + tag -2. `git push origin main --tags` — pushes the commit and tag -3. GitHub Actions builds the plugin and creates a **draft** release with `main.js` and `manifest.json` attached -4. Go to [GitHub Releases](https://github.com/calvinwyoung/obsidian-backlink-settings/releases) and publish the draft +1. `make bump-version TYPE=`: bumps version, creates a release branch, + and pushes it +2. Open a PR on GitHub, review, and merge +3. `make release-tag`: pulls main, tags the merge commit, and pushes the tag +4. GitHub Actions builds the plugin and creates a **draft** release +5. Go to [GitHub + Releases](https://github.com/calvinwyoung/obsidian-backlink-settings/releases) and + publish the draft > **Note:** `.npmrc` sets `tag-version-prefix=""` so tags are bare versions like `1.0.0` (no `v` prefix), which is what the GitHub Actions workflow expects. diff --git a/package.json b/package.json index ebeedce..50ce437 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "scripts": { "dev": "node esbuild.config.mjs", "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", - "version": "node version-bump.mjs && git add manifest.json versions.json", "check": "biome check .", "fix": "biome check --write .", "test": "vitest run"