diff --git a/zhiyin-app/scripts/upload-mp.js b/zhiyin-app/scripts/upload-mp.js index 81f5bc1..854002f 100644 --- a/zhiyin-app/scripts/upload-mp.js +++ b/zhiyin-app/scripts/upload-mp.js @@ -15,11 +15,18 @@ async function main() { ignores: ['node_modules/**/*'], }) - // Get version from git tag or use timestamp + // Bump patch version from git tag: v1.0.16 → 1.0.17 let version = '1.0.3' try { const gitTag = execSync('git describe --tags --abbrev=0 2>/dev/null || echo ""', { encoding: 'utf8' }).trim() - if (gitTag) version = gitTag.replace(/^v/, '') + if (gitTag) { + const base = gitTag.replace(/^v/, '') + const parts = base.split('.') + if (parts.length >= 1) { + parts[parts.length - 1] = String(Number(parts[parts.length - 1]) + 1) + } + version = parts.join('.') + } } catch {} const now = new Date()