Skip to content

Commit d638148

Browse files
committed
release: v2.1.5
1 parent 6c8b777 commit d638148

File tree

4 files changed

+44
-54
lines changed

4 files changed

+44
-54
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build:
10+
name: Create Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@master
15+
16+
- name: Create Release for Tag
17+
id: release_tag
18+
uses: yyx990803/release-tag@master
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.OPER_TOKEN }}
21+
with:
22+
tag_name: ${{ github.ref }}
23+
body: |
24+
Please refer to [CHANGELOG.md](https://github.com/qmhc/vite-plugin-dts/blob/main/CHANGELOG.md) for details.

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [2.1.5](https://github.com/RennCheung/codemirror-editor-vue3/compare/v2.1.4...v2.1.5) (2022-06-02)
2+
3+
4+
### Bug Fixes
5+
6+
* **type:** change codemirror event type([#19](https://github.com/RennCheung/codemirror-editor-vue3/issues/19)) ([f29a9f5](https://github.com/RennCheung/codemirror-editor-vue3/commit/f29a9f5e9e7e06f5fb9d8fc95c17d4b46329621d))
7+
8+
9+
110
## [2.1.4](https://github.com/RennCheung/codemirror-editor-vue3/compare/v2.1.3...v2.1.4) (2022-05-29)
211

312

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "codemirror-editor-vue3",
33
"description": "CodeMirror component for Vue3",
4-
"version": "2.1.4",
4+
"version": "2.1.5",
55
"license": "MIT",
66
"files": [
77
"dist/codemirror-editor-vue3.es.js",
@@ -95,7 +95,7 @@
9595
"unplugin-auto-import": "^0.5.11",
9696
"vite": "^2.7.2",
9797
"vite-plugin-checker": "^0.4.2",
98-
"vite-plugin-dts": "^0.9.9",
98+
"vite-plugin-dts": "^1.2.0",
9999
"vite-plugin-pages": "^0.22.0",
100100
"vite-plugin-windicss": "^1.8.3",
101101
"vitepress": "^0.22.3",

scripts/release.js

Lines changed: 9 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
/**
2-
* 发版规范:
3-
* 1. 版本号由产品经理统一规定,如 2.0.0
4-
* 2. 开发在修复 bug 时,在版本号后增加修复版本号,如 2.0.0-1、2.0.0-2
5-
*
6-
* 注意:
7-
* 1. 如果在 develop 执行 release.js,则会自动同步发版 SYNC_RELEASE_BRANCHES 中的分支
8-
* 2. 如果在其他分支中执行 release.js,则只会在当前分支发版(遵循 git work flow 的 hot-fix 工作法)
9-
* 3. 可以在通过命令行参数指定要发版的分支(分支名称用英文逗号间隔),如: npm run release --syncbranch develop,master
10-
*/
11-
12-
// 在 develop 分支执行发版操作时,同步发版的分支
13-
const SYNC_RELEASE_BRANCHES = [
14-
"test",
15-
// "master"
16-
];
17-
181
/* eslint-disable @typescript-eslint/no-var-requires */
192
const args = require("minimist")(process.argv.slice(2));
203
const fs = require("fs");
@@ -53,20 +36,6 @@ function getCurrentBranch() {
5336
return res.stdout;
5437
}
5538

56-
// 验证需要同步的分支是否存在于远程仓库中
57-
const getSyncBranches = () => {
58-
if (!args.syncbranch) return SYNC_RELEASE_BRANCHES;
59-
const inputBranch = args.syncbranch.split(",");
60-
const allRemoteBranch = execa.commandSync("git branch -r").stdout;
61-
inputBranch.forEach((branch) => {
62-
if (!allRemoteBranch.includes(branch)) {
63-
throw new Error(`远程仓库中没有此分支: ${branch}`);
64-
}
65-
});
66-
return inputBranch;
67-
};
68-
const syncBranch = getSyncBranches();
69-
7039
async function main() {
7140
let targetVersion = args._[0];
7241

@@ -113,9 +82,6 @@ async function main() {
11382
step("\nUpdating cross dependencies...");
11483
updateVersions(targetVersion);
11584

116-
step("publish all packages...");
117-
await run("pnpm", ["run", "publish"]);
118-
11985
// // build all packages with types
12086
// step("\nBuilding all packages...");
12187
// if (!skipBuild && !isDryRun) {
@@ -143,42 +109,33 @@ async function main() {
143109
// 推送当前分支代码
144110
step(`\n[Branch ${getCurrentBranch()}] Pushing to GitLab...`);
145111
await runIfNotDry("git", ["tag", `v${targetVersion}`]);
146-
await runIfNotDry("git", ["push", "origin", `refs/tags/v${targetVersion}`]);
147-
await runIfNotDry("git", ["push"]);
148-
149-
// 如果当前是 develop 分支,则同步发版到 SYNC_RELEASE_BRANCHES 中所有分支
150-
if (getCurrentBranch() == "develop") {
151-
for (const branch of syncBranch) {
152-
step(`\n[Branch ${branch}] Pushing to GitLab...`);
153-
runIfNotDry("git", ["push", branch, `refs/tags/v${targetVersion}`]);
154-
await runIfNotDry("git", ["checkout", branch]);
155-
await runIfNotDry("git", ["merge", "develop"]);
156-
await runIfNotDry("git", ["push"]);
157-
}
158-
await runIfNotDry("git", ["checkout", "develop"]);
159-
}
112+
// await runIfNotDry("git", ["push", "origin", `refs/tags/v${targetVersion}`]);
113+
// await runIfNotDry("git", ["push"]);
160114
};
161115

162116
await syncPushCode();
163117

118+
step("publish all packages...");
119+
await run("pnpm", ["run", "publish"]);
120+
164121
if (isDryRun) {
165122
console.log("\nDry run finished - run git diff to see package changes.");
166123
}
167124

168125
console.log();
169126
}
170127

171-
function updateVersions(version) {
172-
updatePackage(path.resolve(__dirname, "../"), version);
173-
}
174-
175128
function updatePackage(pkgRoot, version) {
176129
const pkgPath = path.resolve(pkgRoot, "package.json");
177130
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
178131
pkg.version = version;
179132
fs.writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
180133
}
181134

135+
function updateVersions(version) {
136+
updatePackage(path.resolve(__dirname, "../"), version);
137+
}
138+
182139
main().catch((err) => {
183140
updateVersions(currentVersion);
184141
console.error(err);

0 commit comments

Comments
 (0)