From 166be925a45414f77e9a04c4381ac6ccf35b1909 Mon Sep 17 00:00:00 2001 From: Quorafind Date: Wed, 27 Aug 2025 17:27:21 +0800 Subject: [PATCH] chore: update workflow scripts --- package.json | 2 +- scripts/smart-beta-release.mjs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5a2a91b9..7b812b5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "task-genius", - "version": "9.7.6", + "version": "9.8.0-beta.0", "description": "Comprehensive task management plugin for Obsidian with progress bars, task status cycling, and advanced task tracking features.", "main": "main.js", "scripts": { diff --git a/scripts/smart-beta-release.mjs b/scripts/smart-beta-release.mjs index 19206dbf..a8475cd4 100644 --- a/scripts/smart-beta-release.mjs +++ b/scripts/smart-beta-release.mjs @@ -8,6 +8,24 @@ import semver from 'semver'; const packageJson = JSON.parse(readFileSync('package.json', 'utf8')); const currentVersion = packageJson.version; +// Get the latest tag version +let latestTag = null; +try { + const tagOutput = execSync('git tag -l --sort=-v:refname | head -1', { encoding: 'utf8' }).trim(); + if (tagOutput) { + latestTag = tagOutput.replace(/^v/, ''); + } +} catch (e) { + // No tags found +} + +// Check for version mismatch warning +if (latestTag && semver.gt(latestTag, currentVersion)) { + console.warn(`⚠️ Warning: package.json version (${currentVersion}) is behind latest tag (${latestTag})`); + console.warn(` You may want to sync package.json version first.`); + console.log(''); +} + // Parse command line arguments const args = process.argv.slice(2); const increment = args[0]; // 'patch', 'minor', 'major', or undefined