fix: bump patch version automatically on mp upload (v1.0.16 → 1.0.17)

This commit is contained in:
yuzhiran
2026-06-21 09:03:34 +08:00
parent 19b087a589
commit 1d1c4ab590
+9 -2
View File
@@ -15,11 +15,18 @@ async function main() {
ignores: ['node_modules/**/*'], 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' let version = '1.0.3'
try { try {
const gitTag = execSync('git describe --tags --abbrev=0 2>/dev/null || echo ""', { encoding: 'utf8' }).trim() 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 {} } catch {}
const now = new Date() const now = new Date()