mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 13:10:30 +08:00
chore: update&fix workflow dev version
This commit is contained in:
parent
195306f251
commit
489dc8ac67
@ -27,8 +27,6 @@ function updatePackageVersion() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
||||||
updatePackageVersion()
|
updatePackageVersion()
|
||||||
}
|
|
||||||
|
|
||||||
export { updatePackageVersion }
|
export { updatePackageVersion }
|
||||||
@ -26,7 +26,7 @@ export function getBaseVersion() {
|
|||||||
const pkg = readFileSync('package.json', 'utf-8')
|
const pkg = readFileSync('package.json', 'utf-8')
|
||||||
const { version } = JSON.parse(pkg)
|
const { version } = JSON.parse(pkg)
|
||||||
// 移除dev版本格式后缀
|
// 移除dev版本格式后缀
|
||||||
return version.replace('-dev', '').replace(/-\d{4}-[a-f0-9]{7}$/, '')
|
return version.replace(/-d\d{2,4}\.[a-f0-9]{7}$/, '')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to read package.json:', error.message)
|
console.error('Failed to read package.json:', error.message)
|
||||||
return '1.0.0'
|
return '1.0.0'
|
||||||
@ -39,7 +39,7 @@ export function getDevVersion() {
|
|||||||
const monthDate = getCurrentMonthDate()
|
const monthDate = getCurrentMonthDate()
|
||||||
const commitHash = getGitCommitHash(true)
|
const commitHash = getGitCommitHash(true)
|
||||||
|
|
||||||
return `${baseVersion}-${monthDate}-${commitHash}`
|
return `${baseVersion}-d${monthDate}.${commitHash}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查当前环境是否为dev构建
|
// 检查当前环境是否为dev构建
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user