Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@coze-arch/rush-publish-plugin",
"comment": "alpha publish prerelease",
"type": "patch"
}
],
"packageName": "@coze-arch/rush-publish-plugin",
"email": "289056872@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@coze-arch/rush-publish-plugin",
"comment": "same with beta",
"type": "patch"
}
],
"packageName": "@coze-arch/rush-publish-plugin",
"email": "289056872@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@coze-arch/rush-publish-plugin",
"comment": "test",
"type": "patch"
}
],
"packageName": "@coze-arch/rush-publish-plugin",
"email": "289056872@qq.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('version management', () => {
{
type: BumpType.BETA,
currentVersion: '1.0.0',
expected: '1.0.0-beta.1',
expected: '1.0.1-beta.1',
prerelease: [],
},
{
Expand All @@ -163,7 +163,7 @@ describe('version management', () => {
{
type: BumpType.ALPHA,
currentVersion: '1.0.0',
expected: '1.0.0-alpha.abc123',
expected: '1.0.1-alpha.abc123',
prerelease: [],
},
{
Expand Down
13 changes: 7 additions & 6 deletions packages/rush-plugins/publish/src/action/publish/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,20 @@ const calculateNewVersion = (
return semver.inc(cc, bumpType) || currentVersion;
}
case BumpType.BETA: {
// 如果当前已经是 beta 版本,增加 beta 版本号
// If already a beta version, increment beta number
if (prerelease[0] === 'beta') {
const nextVersion = semver.inc(currentVersion, 'prerelease', 'beta');
return nextVersion || currentVersion;
}
// 否则基于当前版本创建新的 beta 版本
const baseVersion = `${major}.${minor}.${patch}`;
// Based on the next patch version to create beta version
const nextPatch = prerelease.length > 0 ? patch : patch + 1;
const baseVersion = `${major}.${minor}.${nextPatch}`;
return `${baseVersion}-beta.1`;
}
case BumpType.ALPHA: {
// 否则基于当前版本创建新的 alpha 版本
const baseVersion = `${major}.${minor}.${patch}`;
// 生成随机哈希值
// Based on the next patch version to create alpha version
const nextPatch = prerelease.length > 0 ? patch : patch + 1;
const baseVersion = `${major}.${minor}.${nextPatch}`;
return `${baseVersion}-alpha.${sessionId || randomHash(6)}`;
}
default: {
Expand Down
Loading