diff --git a/.github/workflows/release-tag.yaml b/.github/workflows/release-tag.yaml index 30f0fb2..3759f6c 100644 --- a/.github/workflows/release-tag.yaml +++ b/.github/workflows/release-tag.yaml @@ -20,5 +20,5 @@ jobs: with: tag_name: ${{ github.ref }} body: | - 更新内容请查看[CHANGELOG](https://github.com/varletjs/varlet/blob/dev/CHANGELOG.md)。 - Please refer to [CHANGELOG](https://github.com/varletjs/varlet/blob/dev/CHANGELOG.md) for details. + 更新内容请查看[CHANGELOG](https://github.com/varletjs/release/blob/main/CHANGELOG.md)。 + Please refer to [CHANGELOG](https://github.com/varletjs/release/blob/main/CHANGELOG.md) for details. diff --git a/.prettierignore b/.prettierignore index 3f6af59..ed9a0b6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,6 @@ dist/** -*.md +CHANGELOG.md .github/** .history/** diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..8e06d6b --- /dev/null +++ b/LICENCE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 varlet + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9d2a71a --- /dev/null +++ b/README.md @@ -0,0 +1,116 @@ +

@varlet/release

+ +

+ English | + 中文 +

+

+ NPM Version + License +

+ +## Intro + +`@varlet/release` is a tool to release all packages and generate changelogs. + +## Installation + +### npm + +```shell +npm install --save-dev @varlet/release +``` + +### yarn + +```shell +yarn add @varlet/release -D +``` + +### pnpm + +```shell +pnpm add @varlet/release -D +``` + +## Usage + +### Using Command + +```shell +# Release all packages and generate changelogs +npx vr release + +# Specify remote name +npx vr release -r +# or +npx vr release --remote + +# Just generate changelogs +npx vr changelog + +# Specify changelog filename +npx vr changelog -f +# or +npx vr changelog --file + +``` + +### Configuration + +#### release + +| Params | Instructions | +| -------------------- | ------------------- | +| -r --remote | Specify remote name | + +#### changelog + +| Params | Instructions | +| --------------------------------- | -------------------------- | +| -f --file | Specify changelog filename | +| -rc --releaseCount | Release count | + +### Custom Handle + +#### Example + +```js +import { release, changelog } from '@varlet/release' + +// Do what you want to do... +release() +``` + +You can pass in a task that will be called before the publish after the package version is changed. + +```js +import { release, changelog } from '@varlet/release' + +async function task() { + await doSomething1() + await doSomething2() +} + +release({ task }) +``` + +#### Types + +```ts +interface ReleaseCommandOptions { + remote?: string + task?(): Promise +} +function release(options: ReleaseCommandOptions): Promise + +interface ChangelogCommandOptions { + file?: string + releaseCount?: number +} +function changelog({ releaseCount, file }?: ChangelogCommandOptions): Promise +``` + +## License + +[MIT](https://github.com/varletjs/release/blob/main/LICENSE) diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 0000000..7cecb87 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,116 @@ +

@varlet/release

+ +

+ 中文 | + English +

+

+ NPM Version + License +

+ +## 介绍 + +`@varlet/release 是一个用于发布所有包并生成变更日志的工具。 + +## 安装 + +### npm + +```shell +npm install --save-dev @varlet/release +``` + +### yarn + +```shell +yarn add @varlet/release -D +``` + +### pnpm + +```shell +pnpm add @varlet/release -D +``` + +## 使用 + +### 使用命令 + +```shell +# 发布所有包并生成变更日志 +npx vr release + +# 指定远程仓库名称 +npx vr release -r +# or +npx vr release --remote + +# 仅生成变更日志 +npx vr changelog + +# 指定变更日志文件名 +npx vr changelog -f +# or +npx vr changelog --file + +``` + +### 配置 + +#### release + +| 参数 | 说明 | +| -------------------- | ---------------- | +| -r --remote | 指定远程仓库名称 | + +#### changelog + +| 参数 | 说明 | +| --------------------------------- | ------------------ | +| -f --file | 指定变更日志文件名 | +| -rc --releaseCount | 发布数量 | + +### 自定义处理 + +#### 示例 + +```js +import { release, changelog } from '@varlet/release' + +// Do what you want to do... +release() +``` + +你可以传入一个 `task`,在包版本更改后,在发布之前会调用 `task`。 + +```js +import { release, changelog } from '@varlet/release' + +async function task() { + await doSomething1() + await doSomething2() +} + +release({ task }) +``` + +#### 类型 + +```ts +interface ReleaseCommandOptions { + remote?: string + task?(): Promise +} +function release(options: ReleaseCommandOptions): Promise + +interface ChangelogCommandOptions { + file?: string + releaseCount?: number +} +function changelog({ releaseCount, file }?: ChangelogCommandOptions): Promise +``` + +## License + +[MIT](https://github.com/varletjs/release/blob/main/LICENSE)