cloudcc-cli 0.8.3 → 0.8.7
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/README.md +28 -0
- package/package.json +1 -1
- package/src/publishProject.js +3 -0
- package/utils/changeVersion.js +2 -2
- package/utils/pushCode.js +14 -6
package/README.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# ReleaseV0.8.7
|
|
2
|
+
#### 发布日期:2021-11-26
|
|
3
|
+
#### 发布范围:全量
|
|
4
|
+
#### 发布内容
|
|
5
|
+
* 优化
|
|
6
|
+
* 优化打tag顺序
|
|
7
|
+
|
|
8
|
+
# ReleaseV0.8.6
|
|
9
|
+
#### 发布日期:2021-11-26
|
|
10
|
+
#### 发布范围:全量
|
|
11
|
+
#### 发布内容
|
|
12
|
+
* 优化
|
|
13
|
+
* 更新查询tag命令
|
|
14
|
+
|
|
15
|
+
# ReleaseV0.8.5
|
|
16
|
+
#### 发布日期:2021-11-25
|
|
17
|
+
#### 发布范围:全量
|
|
18
|
+
#### 发布内容
|
|
19
|
+
* 优化
|
|
20
|
+
* RC加入升级第二位version
|
|
21
|
+
|
|
22
|
+
# ReleaseV0.8.4
|
|
23
|
+
#### 发布日期:2021-11-25
|
|
24
|
+
#### 发布范围:全量
|
|
25
|
+
#### 发布内容
|
|
26
|
+
* 优化
|
|
27
|
+
* 打印version信息
|
|
28
|
+
|
|
1
29
|
# ReleaseV0.8.3
|
|
2
30
|
#### 发布日期:2021-11-25
|
|
3
31
|
#### 发布范围:全量
|
package/package.json
CHANGED
package/src/publishProject.js
CHANGED
|
@@ -34,6 +34,9 @@ class Publish {
|
|
|
34
34
|
let condition = await askType();
|
|
35
35
|
// 获得version
|
|
36
36
|
let version = getNewVersionName([condition.type])
|
|
37
|
+
console.log();
|
|
38
|
+
console.log(chalk.green('待发布版本:' + version));
|
|
39
|
+
console.log();
|
|
37
40
|
if (await this.build()) {
|
|
38
41
|
// 将readme生成为html,并复制到dist中
|
|
39
42
|
let outPath = "dist"
|
package/utils/changeVersion.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* @returns 新的版本号
|
|
6
6
|
*/
|
|
7
7
|
// 需要更新第二位
|
|
8
|
-
const updateSecond = ["Release"];
|
|
8
|
+
const updateSecond = ["Release", "GA"];
|
|
9
9
|
|
|
10
10
|
// 需要更新第三位
|
|
11
|
-
const updateLast = ["Dev", "uat", "
|
|
11
|
+
const updateLast = ["Dev", "uat", "RC"];
|
|
12
12
|
|
|
13
13
|
function change(version, type) {
|
|
14
14
|
if (version) {
|
package/utils/pushCode.js
CHANGED
|
@@ -79,14 +79,16 @@ function setTag(types, versions) {
|
|
|
79
79
|
}
|
|
80
80
|
})
|
|
81
81
|
|
|
82
|
-
// 添加tag
|
|
83
|
-
versions.map((version) => {
|
|
84
|
-
exec("git tag " + version)
|
|
85
|
-
})
|
|
82
|
+
// 添加tag,必须先设置不带版本号的tag,否则会报错
|
|
86
83
|
types.map((type) => {
|
|
87
|
-
exec("git tag " + type)
|
|
84
|
+
exec("git tag " + type + " -f")
|
|
88
85
|
})
|
|
89
86
|
|
|
87
|
+
versions.map((version) => {
|
|
88
|
+
exec("git tag " + version + " -f")
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
|
|
90
92
|
// 推送tag
|
|
91
93
|
exec("git push origin --tags")
|
|
92
94
|
console.log(chalk.green('Tag设置成功!'));
|
|
@@ -102,13 +104,18 @@ function getNewVersionName(types) {
|
|
|
102
104
|
exec("git fetch --tags -f")
|
|
103
105
|
return types.map((item) => {
|
|
104
106
|
// 更新本地tag
|
|
105
|
-
let version = exec(`git
|
|
107
|
+
let version = exec(`git tag --sort=-committerdate`)
|
|
106
108
|
version = version.toString("utf8").trim();
|
|
107
109
|
if (version) {
|
|
110
|
+
// 获取第一个版本号
|
|
111
|
+
version = version.split("\n")[0]
|
|
112
|
+
console.log("version 1", version);
|
|
108
113
|
// 取版本号
|
|
109
114
|
version = version.split("-V")[1]
|
|
115
|
+
console.log("version 2", version);
|
|
110
116
|
// 改变版本号
|
|
111
117
|
version = changeVersion.change(version, item)
|
|
118
|
+
console.log("version 3", version);
|
|
112
119
|
// 生成最后的版本号
|
|
113
120
|
item = item + "-V" + version
|
|
114
121
|
} else {
|
|
@@ -124,6 +131,7 @@ function getNewVersionName(types) {
|
|
|
124
131
|
*/
|
|
125
132
|
function pushCodeAndTags(types = []) {
|
|
126
133
|
let versions = getNewVersionName(types);
|
|
134
|
+
|
|
127
135
|
return push(versions[0]) && setTag(types, versions)
|
|
128
136
|
}
|
|
129
137
|
module.exports = { pushCodeAndTags, push, getNewVersionName, setTag }
|