@coze-arch/rush-publish-plugin 0.0.5-alpha.5049d2 → 0.0.5-alpha.e7fa7b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/action/publish/git.d.ts +1 -5
- package/lib/index.js +1 -23
- package/package.json +1 -1
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { type PublishManifest } from './types';
|
|
2
1
|
export declare function createAndPushBranch(branchName: string, cwd: string): Promise<void>;
|
|
3
2
|
interface CommitChangesOptions {
|
|
4
|
-
sessionId: string;
|
|
5
3
|
files: string[];
|
|
6
4
|
cwd: string;
|
|
7
|
-
publishManifests: PublishManifest[];
|
|
8
5
|
branchName: string;
|
|
9
|
-
createTags: boolean;
|
|
10
6
|
}
|
|
11
|
-
export declare function commitChanges({
|
|
7
|
+
export declare function commitChanges({ files, cwd, branchName, }: CommitChangesOptions): Promise<{
|
|
12
8
|
effects: string[];
|
|
13
9
|
branchName: string;
|
|
14
10
|
}>;
|
package/lib/index.js
CHANGED
|
@@ -854,31 +854,15 @@ const generatePublishManifest = async (
|
|
|
854
854
|
|
|
855
855
|
|
|
856
856
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
857
|
async function commitChanges({
|
|
861
|
-
sessionId,
|
|
862
858
|
files,
|
|
863
859
|
cwd,
|
|
864
|
-
publishManifests,
|
|
865
860
|
branchName,
|
|
866
|
-
createTags,
|
|
867
861
|
}) {
|
|
868
862
|
await exec(`git add ${files.join(' ')}`, { cwd });
|
|
869
863
|
await exec(`git commit -m "chore: Publish ${branchName}" -n`, { cwd });
|
|
870
864
|
|
|
871
|
-
|
|
872
|
-
if (createTags) {
|
|
873
|
-
tags = publishManifests.map(
|
|
874
|
-
m => `v/${m.project.packageName}@${m.newVersion}`,
|
|
875
|
-
);
|
|
876
|
-
await exec(
|
|
877
|
-
tags.map(tag => `git tag -a ${tag} -m "Bump type ${tag}"`).join(' && '),
|
|
878
|
-
{ cwd },
|
|
879
|
-
);
|
|
880
|
-
}
|
|
881
|
-
return { effects: [...tags, branchName], branchName };
|
|
865
|
+
return { effects: [branchName], branchName };
|
|
882
866
|
}
|
|
883
867
|
|
|
884
868
|
|
|
@@ -914,7 +898,6 @@ const pushToRemote = async (options) => {
|
|
|
914
898
|
sessionId,
|
|
915
899
|
changedFiles,
|
|
916
900
|
cwd,
|
|
917
|
-
publishManifests,
|
|
918
901
|
bumpPolicy,
|
|
919
902
|
skipCommit,
|
|
920
903
|
skipPush,
|
|
@@ -942,13 +925,9 @@ const pushToRemote = async (options) => {
|
|
|
942
925
|
|
|
943
926
|
// 4. 创建并推送发布分支
|
|
944
927
|
const { effects } = await commitChanges({
|
|
945
|
-
sessionId,
|
|
946
928
|
files: changedFiles,
|
|
947
929
|
cwd,
|
|
948
|
-
publishManifests,
|
|
949
930
|
branchName,
|
|
950
|
-
// 只有 alpha、beta 需要创建 tag,正式发布会在 .github/workflows/common-pr-checks.yml 创建并发布tag
|
|
951
|
-
createTags: isTestPublish,
|
|
952
931
|
});
|
|
953
932
|
if (skipPush) {
|
|
954
933
|
return;
|
|
@@ -1654,7 +1633,6 @@ const publish = async (options) => {
|
|
|
1654
1633
|
} else {
|
|
1655
1634
|
// 普通模式:创建并推送发布分支
|
|
1656
1635
|
await pushToRemote({
|
|
1657
|
-
publishManifests,
|
|
1658
1636
|
bumpPolicy: bumpPolicy ,
|
|
1659
1637
|
sessionId,
|
|
1660
1638
|
changedFiles,
|