mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-25 15:40:02 +00:00
Compare commits
3 Commits
main
...
chore/manu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16cce185fc | ||
|
|
35624ffdfe | ||
|
|
aab2c7343a |
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import * as core from "@actions/core";
|
||||
import semver from "semver";
|
||||
import {obtainClient} from "@/common";
|
||||
|
||||
interface RepoConfig {
|
||||
@@ -57,18 +58,28 @@ const REPO_CONFIGS: Record<string, RepoConfig> = {
|
||||
return ['bump-nightly-version.yml', version];
|
||||
}
|
||||
|
||||
const parts = version.split('.');
|
||||
if (parts.length !== 3) {
|
||||
throw new Error('Invalid version format');
|
||||
// Parse the version using semver library
|
||||
const parsedVersion = semver.parse(version);
|
||||
if (!parsedVersion) {
|
||||
throw new Error(`Invalid semantic version format: ${version}`);
|
||||
}
|
||||
|
||||
// If patch version (last number) is 0, it's a major version
|
||||
// Return only major.minor version
|
||||
if (parts[2] === '0') {
|
||||
return ['bump-version.yml', `${parts[0]}.${parts[1]}`];
|
||||
// If there is a pre-release identifier, throw an error for manual determination
|
||||
if (parsedVersion.prerelease && parsedVersion.prerelease.length > 0) {
|
||||
throw new Error(
|
||||
`Pre-release version "${version}" requires manual determination of which workflow to use.\n` +
|
||||
`Please choose based on the specific situation:\n` +
|
||||
` - bump-version.yml (for major.minor format, such as ${parsedVersion.major}.${parsedVersion.minor})\n` +
|
||||
` - bump-patch-version.yml (for patch version, such as ${parsedVersion.major}.${parsedVersion.minor}.${parsedVersion.patch})\n` +
|
||||
`Considerations include: Is this the first pre-release version? Is it close to the official release?`
|
||||
);
|
||||
}
|
||||
|
||||
// Original logic for official versions
|
||||
if (parsedVersion.patch === 0) {
|
||||
return ['bump-version.yml', `${parsedVersion.major}.${parsedVersion.minor}`];
|
||||
}
|
||||
|
||||
// Otherwise it's a patch version, use full version
|
||||
return ['bump-patch-version.yml', version];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
"conventional-commits-parser": "^5.0.0",
|
||||
"dayjs": "^1.11.11",
|
||||
"dotenv": "^16.4.5",
|
||||
"lodash": "^4.17.21"
|
||||
"lodash": "^4.17.21",
|
||||
"semver": "^7.7.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/conventional-commits-parser": "^5.0.0",
|
||||
|
||||
872
cyborg/pnpm-lock.yaml
generated
872
cyborg/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user