Skip to content

Commit

Permalink
Merge pull request #538 from actiontech/fix/sqle-issue-ee-2106
Browse files Browse the repository at this point in the history
[feature]: append edition info to version when using Git tags
  • Loading branch information
Rain-1214 authored Dec 24, 2024
2 parents f27313c + fa75caa commit c90a462
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"start": "cross-env buildType=ce,SQLE vite --port=3020",
"start:ee": "cross-env buildType=ee,SQLE vite --port=3020",
"start:demo": "cross-env buildType=ce,SQLE,DEMO vite --port=3020",
"build": "node ../../scripts/getGitVersion.mjs && tsc && cross-env NODE_OPTIONS=--max_old_space_size=102400 buildType=ce,SQLE vite build",
"build:ee": "node ../../scripts/getGitVersion.mjs && tsc && cross-env NODE_OPTIONS=--max_old_space_size=102400 buildType=ee,SQLE vite build",
"build:demo": "node ../../scripts/getGitVersion.mjs && tsc && cross-env NODE_OPTIONS=--max_old_space_size=102400 buildType=ce,SQLE,DEMO vite build",
"build": "node ../../scripts/getGitVersion.mjs ce && tsc && cross-env NODE_OPTIONS=--max_old_space_size=102400 buildType=ce,SQLE vite build",
"build:ee": "node ../../scripts/getGitVersion.mjs ee && tsc && cross-env NODE_OPTIONS=--max_old_space_size=102400 buildType=ee,SQLE vite build",
"build:demo": "node ../../scripts/getGitVersion.mjs trial && tsc && cross-env NODE_OPTIONS=--max_old_space_size=102400 buildType=ce,SQLE,DEMO vite build",
"preview": "vite preview",
"test": "jest --watchAll=true",
"test:c": "jest --coverage",
Expand Down
4 changes: 3 additions & 1 deletion scripts/getGitVersion.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const edition = process.argv[2] ?? 'ce';

let version = '';

try {
Expand All @@ -22,7 +24,7 @@ try {
}).trim();

// 如果成功获取到 tag,使用 tag + commitId
version = `${formattedTag} ${commitId}`;
version = `${formattedTag}-${edition} ${commitId}`;
} catch (error) {
// 如果没有 tag,回退到使用分支名 + commitId
const branch = execSync('git rev-parse --abbrev-ref HEAD', {
Expand Down

0 comments on commit c90a462

Please sign in to comment.