瀏覽代碼

[action]Format code

dufu1991 3 年之前
父節點
當前提交
874682309b

+ 56 - 56
.github/ISSUE_TEMPLATE/bug_report.yml

@@ -1,66 +1,66 @@
 name: 🐞 Bug Report
 description: Report an issue with STDF
-title: "[Bug]: "
+title: '[Bug]: '
 labels: ['bug']
 body:
-    - type: markdown
-      attributes:
-          value: |
-              Thank you for taking the time to fill out this bug report! If you have a usage question or are unsure if it's really a bug, please make sure:
+  - type: markdown
+    attributes:
+      value: |
+        Thank you for taking the time to fill out this bug report! If you have a usage question or are unsure if it's really a bug, please make sure:
 
-              - You are using the latest version of the code.
-              - You have checked the open and closed issues to see if your issue has already been reported.
-              - If there is a similar issue in the issues list, please provide additional information in the corresponding issue.
-              - Your description of the problem is concise and clear, not just from your own perspective.
+        - You are using the latest version of the code.
+        - You have checked the open and closed issues to see if your issue has already been reported.
+        - If there is a similar issue in the issues list, please provide additional information in the corresponding issue.
+        - Your description of the problem is concise and clear, not just from your own perspective.
 
-    - type: dropdown
-      id: module
-      attributes:
-          label: Module
-          description: Which module does this bug belong to?
-          options:
-              - stdf (STDF component, default)
-              - create (create-stdf scaffolding)
-              - vscode (STDF VS Code plugin)
-              - icon (rollup-plugin-stdf-icon plugin)
-              - site (STDF website)
-              - demo (STDF demo)
-              - doc (STDF documentation, including components && guide)
-              - other (other)
-      validations:
-          required: true
+  - type: dropdown
+    id: module
+    attributes:
+      label: Module
+      description: Which module does this bug belong to?
+      options:
+        - stdf (STDF component, default)
+        - create (create-stdf scaffolding)
+        - vscode (STDF VS Code plugin)
+        - icon (rollup-plugin-stdf-icon plugin)
+        - site (STDF website)
+        - demo (STDF demo)
+        - doc (STDF documentation, including components && guide)
+        - other (other)
+    validations:
+      required: true
 
-    - type: input
-      id: version
-      attributes:
-          label: Version
-          description: If it is [stdf] [create] [icon] [vscode], please indicate the version in which this bug occurred.
-      validations:
-          required: false
+  - type: input
+    id: version
+    attributes:
+      label: Version
+      description: If it is [stdf] [create] [icon] [vscode], please indicate the version in which this bug occurred.
+    validations:
+      required: false
 
-    - type: textarea
-      id: bug-description
-      attributes:
-          label: Bug Description
-          description: Please describe the bug clearly and concisely.
-          placeholder: When...
-      validations:
-          required: true
+  - type: textarea
+    id: bug-description
+    attributes:
+      label: Bug Description
+      description: Please describe the bug clearly and concisely.
+      placeholder: When...
+    validations:
+      required: true
 
-    - type: textarea
-      id: reproduction
-      attributes:
-          label: Reproduction
-          description: You can use text/images/short videos to explain how to reproduce the issue, but please provide a series of information about the environment where the problem occurs, such as device model and version, operating system and version, browser, etc. You can also use [StackBlitz](https://stackblitz.com) or [CodePen](https://codepen.io) or other online IDEs to quickly create a project to demonstrate the bug. In short, make it easy for others to understand how to reproduce the bug.
-          placeholder: On iPhone 13 Pro with iOS 16...
-      validations:
-          required: true
+  - type: textarea
+    id: reproduction
+    attributes:
+      label: Reproduction
+      description: You can use text/images/short videos to explain how to reproduce the issue, but please provide a series of information about the environment where the problem occurs, such as device model and version, operating system and version, browser, etc. You can also use [StackBlitz](https://stackblitz.com) or [CodePen](https://codepen.io) or other online IDEs to quickly create a project to demonstrate the bug. In short, make it easy for others to understand how to reproduce the bug.
+      placeholder: On iPhone 13 Pro with iOS 16...
+    validations:
+      required: true
 
-    - type: textarea
-      id: idea
-      attributes:
-          label: Your Idea
-          description: If you have a solution or idea for this bug, you can describe it here.
-          placeholder: I think...
-      validations:
-          required: false
+  - type: textarea
+    id: idea
+    attributes:
+      label: Your Idea
+      description: If you have a solution or idea for this bug, you can describe it here.
+      placeholder: I think...
+    validations:
+      required: false

+ 56 - 56
.github/ISSUE_TEMPLATE/bug_report_CN.yml

@@ -1,66 +1,66 @@
 name: 🐞 缺陷报告
 description: 报告 STDF 问题
-title: "[Bug]: "
+title: '[Bug]: '
 labels: ['bug']
 body:
-    - type: markdown
-      attributes:
-          value: |
-              感谢您抽出时间填写这份错误报告!如果您有使用问题,或者不确定是否真的是一个错误,请确保:
+  - type: markdown
+    attributes:
+      value: |
+        感谢您抽出时间填写这份错误报告!如果您有使用问题,或者不确定是否真的是一个错误,请确保:
 
-              - 你使用的是最新版代码。
-              - 你已经查看过开启与关闭状态的 issues ,其中并没有你发现的此问题。
-              - 如果 issues 中已有相同问题,你需要补充,请尽量在对应的 issue 中补充讨论。
-              - 你对问题的表述简洁清晰,不只在你的情景角度能理解。
+        - 你使用的是最新版代码。
+        - 你已经查看过开启与关闭状态的 issues ,其中并没有你发现的此问题。
+        - 如果 issues 中已有相同问题,你需要补充,请尽量在对应的 issue 中补充讨论。
+        - 你对问题的表述简洁清晰,不只在你的情景角度能理解。
 
-    - type: dropdown
-      id: module
-      attributes:
-          label: 模块
-          description: 此缺陷属于哪个模块?
-          options:
-              - stdf (STDF 组件,默认)
-              - create (create-stdf 脚手架)
-              - vscode (STDF VS Code 插件)
-              - icon (rollup-plugin-stdf-icon 插件)
-              - site (STDF 站点)
-              - demo (STDF demo)
-              - doc (STDF 文档,包括 components && guide)
-              - other (其他)
-      validations:
-          required: true
+  - type: dropdown
+    id: module
+    attributes:
+      label: 模块
+      description: 此缺陷属于哪个模块?
+      options:
+        - stdf (STDF 组件,默认)
+        - create (create-stdf 脚手架)
+        - vscode (STDF VS Code 插件)
+        - icon (rollup-plugin-stdf-icon 插件)
+        - site (STDF 站点)
+        - demo (STDF demo)
+        - doc (STDF 文档,包括 components && guide)
+        - other (其他)
+    validations:
+      required: true
 
-    - type: input
-      id: version
-      attributes:
-          label: 版本
-          description: 如果是 [stdf] [create] [icon] [vscode] ,请注明此缺陷出现的版本。
-      validations:
-          required: false
+  - type: input
+    id: version
+    attributes:
+      label: 版本
+      description: 如果是 [stdf] [create] [icon] [vscode] ,请注明此缺陷出现的版本。
+    validations:
+      required: false
 
-    - type: textarea
-      id: bug-description
-      attributes:
-          label: 描述缺陷
-          description: 请清晰简明地描述清楚该缺陷内容。
-          placeholder: 当...
-      validations:
-          required: true
+  - type: textarea
+    id: bug-description
+    attributes:
+      label: 描述缺陷
+      description: 请清晰简明地描述清楚该缺陷内容。
+      placeholder: 当...
+    validations:
+      required: true
 
-    - type: textarea
-      id: reproduction
-      attributes:
-          label: 复现
-          description: 你可以使用文字/图片/简短视频说清楚如何复现此问题,但请尽量说清设备型号与版本、操作系统与版本、浏览器等一系列出现问题的环境。也可以使用 [StackBlitz](https://stackblitz.com) 或者 [CodePen](https://codepen.io) 或其他在线 IDE 快速创建一个工程展示此缺陷。总之让别人能快速明白此缺陷的复现情况。
-          placeholder: 在 iPhone 13 Pro 的 iOS 16...
-      validations:
-          required: true
+  - type: textarea
+    id: reproduction
+    attributes:
+      label: 复现
+      description: 你可以使用文字/图片/简短视频说清楚如何复现此问题,但请尽量说清设备型号与版本、操作系统与版本、浏览器等一系列出现问题的环境。也可以使用 [StackBlitz](https://stackblitz.com) 或者 [CodePen](https://codepen.io) 或其他在线 IDE 快速创建一个工程展示此缺陷。总之让别人能快速明白此缺陷的复现情况。
+      placeholder: 在 iPhone 13 Pro 的 iOS 16...
+    validations:
+      required: true
 
-    - type: textarea
-      id: idea
-      attributes:
-          label: 你的想法
-          description: 如果你对该缺陷有解决方案或思路,可以在这里描述。
-          placeholder: 我认为...
-      validations:
-          required: false
+  - type: textarea
+    id: idea
+    attributes:
+      label: 你的想法
+      description: 如果你对该缺陷有解决方案或思路,可以在这里描述。
+      placeholder: 我认为...
+    validations:
+      required: false

+ 48 - 48
.github/ISSUE_TEMPLATE/feature_request.yml

@@ -3,56 +3,56 @@ description: Submit a request for a new feature
 title: '[Feature]: '
 labels: ['enhancement']
 body:
-    - type: markdown
-      attributes:
-          value: |
-              Thank you for taking the time to fill out this feature request! If you have a new idea or are unsure if it can be implemented, please make sure:
+  - type: markdown
+    attributes:
+      value: |
+        Thank you for taking the time to fill out this feature request! If you have a new idea or are unsure if it can be implemented, please make sure:
 
-              - You have checked the latest version of the code and confirmed that the feature does not exist.
-              - You have checked the open and closed issues to see if the feature you want to add has been described.
-              - If there is a similar feature request in the issues list, please provide additional information in the corresponding issue.
-              - Your description of the new feature is concise and clear, not just from your own perspective.
+        - You have checked the latest version of the code and confirmed that the feature does not exist.
+        - You have checked the open and closed issues to see if the feature you want to add has been described.
+        - If there is a similar feature request in the issues list, please provide additional information in the corresponding issue.
+        - Your description of the new feature is concise and clear, not just from your own perspective.
 
-    - type: dropdown
-      id: module
-      attributes:
-          label: Module
-          description: Which module does this new feature belong to?
-          options:
-              - stdf (STDF component, default)
-              - create (create-stdf scaffolding)
-              - vscode (STDF VS Code plugin)
-              - icon (rollup-plugin-stdf-icon plugin)
-              - site (STDF website)
-              - demo (STDF demo)
-              - doc (STDF documentation, including components && guide)
-              - other (other)
-      validations:
-          required: true
+  - type: dropdown
+    id: module
+    attributes:
+      label: Module
+      description: Which module does this new feature belong to?
+      options:
+        - stdf (STDF component, default)
+        - create (create-stdf scaffolding)
+        - vscode (STDF VS Code plugin)
+        - icon (rollup-plugin-stdf-icon plugin)
+        - site (STDF website)
+        - demo (STDF demo)
+        - doc (STDF documentation, including components && guide)
+        - other (other)
+    validations:
+      required: true
 
-    - type: textarea
-      id: description
-      attributes:
-          label: Feature Description
-          description: Please describe the new feature clearly and concisely.
-          placeholder: When...
-      validations:
-          required: true
+  - type: textarea
+    id: description
+    attributes:
+      label: Feature Description
+      description: Please describe the new feature clearly and concisely.
+      placeholder: When...
+    validations:
+      required: true
 
-    - type: textarea
-      id: example
-      attributes:
-          label: Example
-          description: You can provide some similar implementations in other projects to help others understand your idea.
-          placeholder: In...
-      validations:
-          required: false
+  - type: textarea
+    id: example
+    attributes:
+      label: Example
+      description: You can provide some similar implementations in other projects to help others understand your idea.
+      placeholder: In...
+    validations:
+      required: false
 
-    - type: textarea
-      id: idea
-      attributes:
-          label: Your Idea
-          description: If you have any implementation ideas or thoughts about the new feature, you can describe them here.
-          placeholder: I think...
-      validations:
-          required: false
+  - type: textarea
+    id: idea
+    attributes:
+      label: Your Idea
+      description: If you have any implementation ideas or thoughts about the new feature, you can describe them here.
+      placeholder: I think...
+    validations:
+      required: false

+ 48 - 48
.github/ISSUE_TEMPLATE/feature_request_CN.yml

@@ -3,56 +3,56 @@ description: 提交一个新功能的需求
 title: '[Feature]: '
 labels: ['enhancement']
 body:
-    - type: markdown
-      attributes:
-          value: |
-              感谢您抽出时间填写这份新功能请求报告!如果您有新的想法,或者不确定是否能实现,请确保:
+  - type: markdown
+    attributes:
+      value: |
+        感谢您抽出时间填写这份新功能请求报告!如果您有新的想法,或者不确定是否能实现,请确保:
 
-              - 你已经查看最新版代码无此功能。
-              - 你已经查看过开启与关闭状态的 issues ,其中并没有你想增加的功能描述。
-              - 如果 issues 中已有相同新功能,你需要补充,请尽量在对应的 issue 中补充讨论。
-              - 你对新功能的表述简洁清晰,不只在你的情景角度能理解。
+        - 你已经查看最新版代码无此功能。
+        - 你已经查看过开启与关闭状态的 issues ,其中并没有你想增加的功能描述。
+        - 如果 issues 中已有相同新功能,你需要补充,请尽量在对应的 issue 中补充讨论。
+        - 你对新功能的表述简洁清晰,不只在你的情景角度能理解。
 
-    - type: dropdown
-      id: module
-      attributes:
-          label: 模块
-          description: 此新功能属于哪个模块?
-          options:
-              - stdf (STDF 组件,默认)
-              - create (create-stdf 脚手架)
-              - vscode (STDF VS Code 插件)
-              - icon (rollup-plugin-stdf-icon 插件)
-              - site (STDF 站点)
-              - demo (STDF demo)
-              - doc (STDF 文档,包括 components && guide)
-              - other (其他)
-      validations:
-          required: true
+  - type: dropdown
+    id: module
+    attributes:
+      label: 模块
+      description: 此新功能属于哪个模块?
+      options:
+        - stdf (STDF 组件,默认)
+        - create (create-stdf 脚手架)
+        - vscode (STDF VS Code 插件)
+        - icon (rollup-plugin-stdf-icon 插件)
+        - site (STDF 站点)
+        - demo (STDF demo)
+        - doc (STDF 文档,包括 components && guide)
+        - other (其他)
+    validations:
+      required: true
 
-    - type: textarea
-      id: description
-      attributes:
-          label: 新功能描述
-          description: 请清晰简明地描述清楚该新功能内容。
-          placeholder: 当...
-      validations:
-          required: true
+  - type: textarea
+    id: description
+    attributes:
+      label: 新功能描述
+      description: 请清晰简明地描述清楚该新功能内容。
+      placeholder: 当...
+    validations:
+      required: true
 
-    - type: textarea
-      id: example
-      attributes:
-          label: 示例
-          description: 你可以给出一些在其他项目中类似的实现,方便大家理解你的想法。
-          placeholder: 在...
-      validations:
-          required: false
+  - type: textarea
+    id: example
+    attributes:
+      label: 示例
+      description: 你可以给出一些在其他项目中类似的实现,方便大家理解你的想法。
+      placeholder: 在...
+    validations:
+      required: false
 
-    - type: textarea
-      id: idea
-      attributes:
-          label: 你的想法
-          description: 如果你对新功能有实现思路或任何想法,可以在这里描述。
-          placeholder: 我认为...
-      validations:
-          required: false
+  - type: textarea
+    id: idea
+    attributes:
+      label: 你的想法
+      description: 如果你对新功能有实现思路或任何想法,可以在这里描述。
+      placeholder: 我认为...
+    validations:
+      required: false

+ 30 - 30
.github/workflows/publish-create.yml

@@ -3,38 +3,38 @@
 name: PUBLISH CREATE
 
 on:
-    push:
-        branches:
-            - main
-        paths:
-            - 'packages/create-stdf/package.json'
+  push:
+    branches:
+      - main
+    paths:
+      - 'packages/create-stdf/package.json'
 
 jobs:
-    publish:
-        runs-on: ubuntu-latest
+  publish:
+    runs-on: ubuntu-latest
 
-        steps:
-            - name: Checkout
-              uses: actions/checkout@v2
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
 
-            - name: Setup Node.js environment
-              uses: actions/setup-node@v1
-              with:
-                  node-version: 18.x
+      - name: Setup Node.js environment
+        uses: actions/setup-node@v1
+        with:
+          node-version: 18.x
 
-            # cd packages/create-stdf 目录下
-            # 安装依赖 npm install
-            # 打包 npm run build
-            # 执行 npm run update
-            # 发布 create-stdf 到 npm
-            - name: Publish
-              run: |
-                  cd packages/create-stdf
-                  npm install
-                  npm run build
-                  npm run update
-                  npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
-                  npm publish
-              env:
-                  CI: true
-                  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_CREATE }}
+      # cd packages/create-stdf 目录下
+      # 安装依赖 npm install
+      # 打包 npm run build
+      # 执行 npm run update
+      # 发布 create-stdf 到 npm
+      - name: Publish
+        run: |
+          cd packages/create-stdf
+          npm install
+          npm run build
+          npm run update
+          npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
+          npm publish
+        env:
+          CI: true
+          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_CREATE }}

+ 28 - 28
.github/workflows/publish-icon.yml

@@ -3,36 +3,36 @@
 name: PUBLISH ICON
 
 on:
-    push:
-        branches:
-            - main
-        paths:
-            - 'packages/rollup-plugin-stdf-icon/package.json'
+  push:
+    branches:
+      - main
+    paths:
+      - 'packages/rollup-plugin-stdf-icon/package.json'
 
 jobs:
-    publish:
-        runs-on: ubuntu-latest
+  publish:
+    runs-on: ubuntu-latest
 
-        steps:
-            - name: Checkout
-              uses: actions/checkout@v2
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
 
-            - name: Setup Node.js environment
-              uses: actions/setup-node@v1
-              with:
-                  node-version: 18.x
+      - name: Setup Node.js environment
+        uses: actions/setup-node@v1
+        with:
+          node-version: 18.x
 
-            # cd packages/rollup-plugin-stdf-icon 目录下
-            # 安装依赖 npm install
-            # 打包 npm run build
-            # 发布 rollup-plugin-stdf-icon 到 npm
-            - name: Publish
-              run: |
-                  cd packages/rollup-plugin-stdf-icon
-                  npm install
-                  npm run build 
-                  npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
-                  npm publish
-              env:
-                  CI: true
-                  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ICON }}
+      # cd packages/rollup-plugin-stdf-icon 目录下
+      # 安装依赖 npm install
+      # 打包 npm run build
+      # 发布 rollup-plugin-stdf-icon 到 npm
+      - name: Publish
+        run: |
+          cd packages/rollup-plugin-stdf-icon
+          npm install
+          npm run build 
+          npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
+          npm publish
+        env:
+          CI: true
+          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ICON }}

+ 25 - 25
.github/workflows/publish-vscode.yml

@@ -3,33 +3,33 @@
 name: PUBLISH VSCODE
 
 on:
-    push:
-        branches:
-            - main
-        paths:
-            - 'packages/vscode-extension/package.json'
+  push:
+    branches:
+      - main
+    paths:
+      - 'packages/vscode-extension/package.json'
 
 jobs:
-    publish:
-        runs-on: ubuntu-latest
+  publish:
+    runs-on: ubuntu-latest
 
-        steps:
-            - name: Checkout
-              uses: actions/checkout@v2
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
 
-            - name: Setup Node.js environment
-              uses: actions/setup-node@v1
-              with:
-                  node-version: 18.x
+      - name: Setup Node.js environment
+        uses: actions/setup-node@v1
+        with:
+          node-version: 18.x
 
-            # cd 到 packages/vscode-extension 目录
-            # 执行 doc && list
-            # 安装依赖
-            - name: Publish
-              run: |
-                  cd packages/vscode-extension
-                  npm run doc
-                  npm run list
-                  npm install
-                  npm install -g @vscode/vsce
-                  vsce publish -p ${{ secrets.VSCE_TOKEN }}
+      # cd 到 packages/vscode-extension 目录
+      # 执行 doc && list
+      # 安装依赖
+      - name: Publish
+        run: |
+          cd packages/vscode-extension
+          npm run doc
+          npm run list
+          npm install
+          npm install -g @vscode/vsce
+          vsce publish -p ${{ secrets.VSCE_TOKEN }}

+ 60 - 60
.github/workflows/releases.yml

@@ -3,73 +3,73 @@
 name: RELEASES
 
 on:
-    push:
-        branches:
-            - main
-        paths:
-            - 'packages/stdf/package.json'
+  push:
+    branches:
+      - main
+    paths:
+      - 'packages/stdf/package.json'
 
 jobs:
-    releases:
-        runs-on: ubuntu-latest
+  releases:
+    runs-on: ubuntu-latest
 
-        steps:
-            - name: Checkout
-              uses: actions/checkout@v2
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
 
-            # 1. 读取 packages/stdf/package.json 中的 version 字段,作为 Releases tag 和 Releases title
-            - name: Get version
-              id: version
-              run: |
-                  echo version=$(cat packages/stdf/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
+      # 1. 读取 packages/stdf/package.json 中的 version 字段,作为 Releases tag 和 Releases title
+      - name: Get version
+        id: version
+        run: |
+          echo version=$(cat packages/stdf/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
 
-            # 2. 读取 doc/guide/changelog.md 的第一行内容,去除 ## 和空格
-            - name: Get md_version
-              id: md_version
-              run: |
-                  echo md_version=$(cat doc/guide/changelog.md | head -1 | sed 's/## //g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
+      # 2. 读取 doc/guide/changelog.md 的第一行内容,去除 ## 和空格
+      - name: Get md_version
+        id: md_version
+        run: |
+          echo md_version=$(cat doc/guide/changelog.md | head -1 | sed 's/## //g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
 
-            # 3. 读取 doc/guide/changelog_en.md 的第一行内容,去除 ## 和空格
-            - name: Get md_version_en
-              id: md_version_en
-              run: |
-                  echo md_version_en=$(cat doc/guide/changelog_en.md | head -1 | sed 's/## //g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
+      # 3. 读取 doc/guide/changelog_en.md 的第一行内容,去除 ## 和空格
+      - name: Get md_version_en
+        id: md_version_en
+        run: |
+          echo md_version_en=$(cat doc/guide/changelog_en.md | head -1 | sed 's/## //g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
 
-            # 4. 比较 Get version 与 Get md_version 和 Get md_version_en 三者的输出内容,如果不相同则此次不需要发布 Release,退出
-            - name: Check version
-              run: |
-                  if [[ ${{ steps.version.outputs.version }} != ${{ steps.md_version.outputs.md_version }} ]]; then
-                      echo "This is not a tag push. Skipping."
-                      exit 78
-                  fi
-                  if [[ ${{ steps.version.outputs.version }} != ${{ steps.md_version_en.outputs.md_version_en }} ]]; then
-                      echo "This is not a tag push. Skipping."
-                      exit 78
-                  fi
+      # 4. 比较 Get version 与 Get md_version 和 Get md_version_en 三者的输出内容,如果不相同则此次不需要发布 Release,退出
+      - name: Check version
+        run: |
+          if [[ ${{ steps.version.outputs.version }} != ${{ steps.md_version.outputs.md_version }} ]]; then
+              echo "This is not a tag push. Skipping."
+              exit 78
+          fi
+          if [[ ${{ steps.version.outputs.version }} != ${{ steps.md_version_en.outputs.md_version_en }} ]]; then
+              echo "This is not a tag push. Skipping."
+              exit 78
+          fi
 
-            # 5. 读取 doc/guide/changelog.md 中前两个二级标题之间的内容,包含换行和空格
-            - name: Get changelog
-              id: changelog
-              run: |
-                  echo -e changelog=$(sed -n '1,/##/{/##/!p;}' doc/guide/changelog.md | sed '/^$/d') >> $GITHUB_OUTPUT
+      # 5. 读取 doc/guide/changelog.md 中前两个二级标题之间的内容,包含换行和空格
+      - name: Get changelog
+        id: changelog
+        run: |
+          echo -e changelog=$(sed -n '1,/##/{/##/!p;}' doc/guide/changelog.md | sed '/^$/d') >> $GITHUB_OUTPUT
 
-            # 6. 读取 doc/guide/changelog_en.md 中第一个二级标题与第二个二级标题之间的内容,包含换行和空格
-            - name: Get changelog_en
-              id: changelog_en
-              run: |
-                  echo -e changelog_en=$(sed -n '1,/##/{/##/!p;}' doc/guide/changelog_en.md | sed '/^$/d') >> $GITHUB_OUTPUT
+      # 6. 读取 doc/guide/changelog_en.md 中第一个二级标题与第二个二级标题之间的内容,包含换行和空格
+      - name: Get changelog_en
+        id: changelog_en
+        run: |
+          echo -e changelog_en=$(sed -n '1,/##/{/##/!p;}' doc/guide/changelog_en.md | sed '/^$/d') >> $GITHUB_OUTPUT
 
-            # 7. 作为 latest release 发布本次 Release,body 为 changelog 和 changelog_en 的合并内容,中间使用 --- 分隔
-            - name: Release
-              uses: actions/create-release@v1
-              env:
-                  GITHUB_TOKEN: ${{ secrets.STDF_GITHUB_TOKEN }}
-              with:
-                  tag_name: v${{ steps.version.outputs.version }}
-                  release_name: v${{ steps.version.outputs.version }}
-                  body: |
-                      ${{ steps.changelog.outputs.changelog }}
-                      ---
-                      ${{ steps.changelog_en.outputs.changelog_en }}
-                  draft: false
-                  prerelease: false
+      # 7. 作为 latest release 发布本次 Release,body 为 changelog 和 changelog_en 的合并内容,中间使用 --- 分隔
+      - name: Release
+        uses: actions/create-release@v1
+        env:
+          GITHUB_TOKEN: ${{ secrets.STDF_GITHUB_TOKEN }}
+        with:
+          tag_name: v${{ steps.version.outputs.version }}
+          release_name: v${{ steps.version.outputs.version }}
+          body: |
+            ${{ steps.changelog.outputs.changelog }}
+            ---
+            ${{ steps.changelog_en.outputs.changelog_en }}
+          draft: false
+          prerelease: false

+ 55 - 55
.github/workflows/sync-demo.yml

@@ -3,60 +3,60 @@
 name: SYNC DEMO
 
 on:
-    push:
-        branches:
-            - main
-        paths:
-            - 'demo/**'
+  push:
+    branches:
+      - main
+    paths:
+      - 'demo/**'
 
 jobs:
-    build-and-deploy:
-        runs-on: ubuntu-latest
-        steps:
-            - name: Checkout
-              uses: actions/checkout@v2
-
-            # clone 仓库 github.com/dufu1991/stdf
-            - name: Clone stdf
-              uses: actions/checkout@v3
-              with:
-                  repository: dufu1991/stdf
-                  token: ${{ secrets.STDF_GITHUB_TOKEN }}
-                  path: stdf
-
-            # 读取 packages/stdf/package.json 中的 version 字段,作为 stdf 的最新版本
-            - name: Get version
-              id: version
-              run: |
-                  echo version=$(cat packages/stdf/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
-
-            # 读取 packages/rollup-plugin-stdf-icon/package.json 中的 version 字段,作为 rollup-plugin-stdf-icon 的最新版本
-            - name: Get rollup-plugin-stdf-icon version
-              id: rollup-plugin-stdf-icon-version
-              run: |
-                  echo rollup-plugin-stdf-icon-version=$(cat packages/rollup-plugin-stdf-icon/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
-
-            # cd 到 stdf/demo 文件内,初始化本地仓库
-            # 将 demo/package.json 内的 file:../packages/stdf 替换为 ^${{ steps.version.outputs.version }}
-            # 将 demo/package.json 内的 file:../packages/rollup-plugin-stdf-icon 替换为 ^${{ steps.rollup-plugin-stdf-icon-version.outputs.rollup-plugin-stdf-icon-version }}
-            # 将 demo 目录下的所有文件提交到本地仓库,提交信息为 Github Actions auto commit: update demo from stdf.
-            - name: Init stdf demo
-              run: |
-                  cd stdf/demo
-                  git init
-                  git config --global user.name 'GitHub Actions'
-                  git config --global user.email 'GitHub Actions'
-                  sed -i 's#file:../packages/stdf#^${{ steps.version.outputs.version }}#' package.json
-                  sed -i 's#file:../packages/rollup-plugin-stdf-icon#^${{ steps.rollup-plugin-stdf-icon-version.outputs.rollup-plugin-stdf-icon-version }}#' package.json
-                  git add .
-                  git commit -m "Github Actions auto commit: update demo from stdf."
-
-            # 将修改内容推送到 git@github.com:dufu1991/demo-stdf.git 的 main 分支
-            - name: Push to demo-stdf
-              uses: ad-m/github-push-action@master
-              with:
-                  github_token: ${{ secrets.STDF_GITHUB_TOKEN }}
-                  branch: main
-                  force: true
-                  directory: stdf/demo
-                  repository: dufu1991/demo-stdf
+  build-and-deploy:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+
+      # clone 仓库 github.com/dufu1991/stdf
+      - name: Clone stdf
+        uses: actions/checkout@v3
+        with:
+          repository: dufu1991/stdf
+          token: ${{ secrets.STDF_GITHUB_TOKEN }}
+          path: stdf
+
+      # 读取 packages/stdf/package.json 中的 version 字段,作为 stdf 的最新版本
+      - name: Get version
+        id: version
+        run: |
+          echo version=$(cat packages/stdf/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
+
+      # 读取 packages/rollup-plugin-stdf-icon/package.json 中的 version 字段,作为 rollup-plugin-stdf-icon 的最新版本
+      - name: Get rollup-plugin-stdf-icon version
+        id: rollup-plugin-stdf-icon-version
+        run: |
+          echo rollup-plugin-stdf-icon-version=$(cat packages/rollup-plugin-stdf-icon/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
+
+      # cd 到 stdf/demo 文件内,初始化本地仓库
+      # 将 demo/package.json 内的 file:../packages/stdf 替换为 ^${{ steps.version.outputs.version }}
+      # 将 demo/package.json 内的 file:../packages/rollup-plugin-stdf-icon 替换为 ^${{ steps.rollup-plugin-stdf-icon-version.outputs.rollup-plugin-stdf-icon-version }}
+      # 将 demo 目录下的所有文件提交到本地仓库,提交信息为 Github Actions auto commit: update demo from stdf.
+      - name: Init stdf demo
+        run: |
+          cd stdf/demo
+          git init
+          git config --global user.name 'GitHub Actions'
+          git config --global user.email 'GitHub Actions'
+          sed -i 's#file:../packages/stdf#^${{ steps.version.outputs.version }}#' package.json
+          sed -i 's#file:../packages/rollup-plugin-stdf-icon#^${{ steps.rollup-plugin-stdf-icon-version.outputs.rollup-plugin-stdf-icon-version }}#' package.json
+          git add .
+          git commit -m "Github Actions auto commit: update demo from stdf."
+
+      # 将修改内容推送到 git@github.com:dufu1991/demo-stdf.git 的 main 分支
+      - name: Push to demo-stdf
+        uses: ad-m/github-push-action@master
+        with:
+          github_token: ${{ secrets.STDF_GITHUB_TOKEN }}
+          branch: main
+          force: true
+          directory: stdf/demo
+          repository: dufu1991/demo-stdf

+ 13 - 13
.github/workflows/sync-gitee.yml

@@ -3,18 +3,18 @@
 name: SYNC GITEE
 
 on:
-    schedule:
-        - cron: '0 1 * * *'
+  schedule:
+    - cron: '0 1 * * *'
 
 jobs:
-    build:
-        runs-on: ubuntu-latest
-        steps:
-            - name: Black list
-              uses: Yikun/hub-mirror-action@master
-              with:
-                  src: github/dufu1991
-                  dst: gitee/dufu1991
-                  dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
-                  dst_token: ${{ secrets.GITEE_TOKEN }}
-                  static_list: 'stdf'
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Black list
+        uses: Yikun/hub-mirror-action@master
+        with:
+          src: github/dufu1991
+          dst: gitee/dufu1991
+          dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
+          dst_token: ${{ secrets.GITEE_TOKEN }}
+          static_list: 'stdf'