Skip to content

Commit

Permalink
docs: change publish readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomchan-cxj authored and ilikethese committed Oct 30, 2020
1 parent 60bed9d commit 2ccb807
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions PUBLISH.zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Hippy 发布文档

Hippy版本管理遵循所有模块使用同一版本原则

## 1. 更新版本号

前端使用 [lerna](https://lerna.js.org/) 进行版本管理和 CHANGELOG 生成,但因为需要更新终端包所以不能使用它的发布功能。

更新版本和 CHANGELOG 使用:

```bash
lerna version --conventional-commits --tag-version-prefix=''
lerna version [VERSION] --conventional-commits --tag-version-prefix='' --no-push
```

* `[VERSION]` - 要发布的版本号,如2.1.0。
* `--conventional-commits` - 生成基于 conventional 提交规范的 CHANGELOG。
* `--tag-version-prefix` - 改为空字符,这样生成的版本号 tag 前面就不会带上默认的 `v`
* `--no-push` - 不会将tag推动到远程。

## 2. 回退 commit 并删除自动生成的 tag

Expand All @@ -21,7 +25,7 @@ lerna 生成版本号和 CHANGELOG 后,需要回退一下版本,所有发布
git rebase -i HEAD^
```

进入 vim 或者编辑器后选择最后一个版本的 commit,并选择 edit,如果是 vim 则输入 `:` 并输入 `wq` 保存退出 vim。
进入 vim 或者编辑器后选择最后一个版本的 commit,并将要修改的 `pick` 修改成 `edit`,如果是 vim 则输入 `:` 并输入 `wq` 保存退出 vim。

此时进入 rebase 状态。

Expand All @@ -31,7 +35,7 @@ git rebase -i HEAD^
git commit --amend -S
```

输入符合 [Convention Commit](https://conventionalcommits.org/) 规范的 commit message,版本发布一般推荐使用:`chore[release]: released [VERSION]` 这样的 commit message。
输入符合 [Convention Commit](https://conventionalcommits.org/) 规范的 commit message,版本发布一般推荐使用:`chore(release): released [VERSION]` 这样的 commit message。

同时删除 tag,一会儿更新后需要重新生成 tag

Expand Down Expand Up @@ -109,7 +113,7 @@ git push --tags # 提交 tag
* 前端发布到 npmjs.com

```bash
lerna exec "npm run publish"
lerna exec "npm publish"
```

> 如果开启了 npm 二次验证会一直问你一次性密码,正常输入即可。
Expand All @@ -121,4 +125,4 @@ git push --tags # 提交 tag
```

* Android 发布到 [bintray](https://bintray.com/beta/#/hippy/Hippy/hippy-release?tab=overview)
在 Android Studio 中打开 `examples/android-demo` 项目,在`local.properties`添加`bintrayUser=[user]``bintrayKey=[key]`,其中`[user]``[key]` 分别对应用户在bintray的 `账号名``API key` ,添加完后字旁边的 Gradle 面板中运行 `android-demo` > `android-sdk` > `publishing` > `:android-sdk:bintrayUpload` .
在 Android Studio 中打开 `examples/android-demo` 项目,在`local.properties`添加`bintrayUser=[user]``bintrayKey=[key]`,其中`[user]``[key]` 分别对应用户在bintray的 `账号名``API key` ,添加完后字旁边的 Gradle 面板中运行 `android-demo` > `android-sdk` > `publishing` > `:android-sdk:bintrayUpload` 即可发布.

0 comments on commit 2ccb807

Please sign in to comment.