Commit f0b0a429 by Jaxon

feat: 新增.github各个工作流配置. 并去掉vben相关影响

1 parent 99bbfbe4
# default onwer
# vben core onwer
# vben team onwer
name: 🐞 Bug Report
description: Report an issue with Vben Admin to help us make it better.
title: "Bug: "
labels: ["bug: pending triage"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: dropdown
id: version
attributes:
label: Version
description: What version of our software are you running?
options:
- Vben Admin V5
- Vben Admin V2
default: 0
validations:
required: true
- type: textarea
id: bug-desc
attributes:
label: Describe the bug?
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: Bug Description
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Please provide a link to [StackBlitz](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/basic?initialPath=__vitest__/) (you can also use [examples](https://github.com/vitest-dev/vitest/tree/main/examples)) or a github repo that can reproduce the problem you ran into. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "needs reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed.
placeholder: Reproduction
validations:
required: true
- type: textarea
id: system-info
attributes:
label: System Info
description: Output of `npx envinfo --system --npmPackages '{vue}' --binaries --browsers`
render: shell
placeholder: System, Binaries, Browsers
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: checkboxes
id: terms
attributes:
label: Validations
description: Before submitting the issue, please make sure you do the following
# description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com).
options:
- label: Read the [docs](https://doc.vben.pro/)
required: true
- label: Ensure the code is up to date. (Some issues have been fixed in the latest version)
required: true
- label: I have searched the [existing issues](https://github.com/vbenjs/vue-vben-admin/issues) and checked that my issue does not duplicate any existing issues.
required: true
- label: Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vbenjs/vue-vben-admin/discussions) or join our [Discord Chat Server](https://discord.gg/8GuAdwDhj6).
required: true
- label: The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
required: true
name: 📚 Documentation
description: Report an issue with Vben Admin Website to help us make it better.
title: 'Docs: '
labels: [documentation]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this issue!
- type: checkboxes
id: documentation_is
attributes:
label: Documentation is
options:
- label: Missing
- label: Outdated
- label: Confusing
- label: Not sure?
- type: textarea
id: description
attributes:
label: Explain in Detail
description: A clear and concise description of your suggestion. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: The description of ... page is not clear. I thought it meant ... but it wasn't.
validations:
required: true
- type: textarea
id: suggestion
attributes:
label: Your Suggestion for Changes
validations:
required: true
- type: textarea
id: reproduction-steps
attributes:
label: Steps to reproduce
description: Please provide any reproduction steps that may need to be described. E.g. if it happens only when running the dev or build script make sure it's clear which one to use.
placeholder: Run `pnpm install` followed by `pnpm run docs:dev`
name: ✨ New Feature Proposal
description: Propose a new feature to be added to Vben Admin
title: 'FEATURE: '
labels: ['enhancement: pending triage']
body:
- type: markdown
attributes:
value: |
Thank you for suggesting a feature for our project! Please fill out the information below to help us understand and implement your request!
- type: dropdown
id: version
attributes:
label: Version
description: What version of our software are you running?
options:
- Vben Admin V5
- Vben Admin V2
default: 0
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: A detailed description of the feature request.
placeholder: Please describe the feature you would like to see, and why it would be useful.
validations:
required: true
- type: textarea
id: proposed-solution
attributes:
label: Proposed Solution
description: A clear and concise description of what you want to happen.
placeholder: Describe the solution you'd like to see
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives Considered
description: |
A clear and concise description of any alternative solutions or features you've considered.
placeholder: Describe any alternative solutions or features you've considered
validations:
required: false
- type: input
id: additional-context
attributes:
label: Additional Context
description: Add any other context or screenshots about the feature request here.
placeholder: Any additional information
validations:
required: false
- type: checkboxes
id: checkboxes
attributes:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Read the [docs](https://doc.vben.pro/)
required: true
- label: Ensure the code is up to date. (Some issues have been fixed in the latest version)
required: true
- label: I have searched the [existing issues](https://github.com/vbenjs/vue-vben-admin/issues) and checked that my issue does not duplicate any existing issues.
required: true
name: "Setup Node"
description: "Setup node and pnpm"
runs:
using: "composite"
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: "pnpm"
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
if: ${{ github.ref_name == 'main' }}
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: actions/cache/restore@v4
if: ${{ github.ref_name != 'main' }}
with:
path: ${{ env.STORE_PATH }}
key: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
## Git 提交信息规范
> 本规范改编自 [Angular 的提交规范](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)。
#### 快速总结:
提交信息必须匹配以下正则表达式:
```js
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip): .{1,50}/;
```
#### 示例
出现在 "功能" 标题下的 `dev` 小标题下:
```
feat(dev): add 'comments' option
```
出现在 "Bug 修复" 标题下的 `dev` 小标题下,并链接到 issue #28:
```
fix(dev): fix dev error
close #28
```
出现在 "性能提升" 标题下,以及 "破坏性变更" 中并包含破坏性变更说明:
```
perf(build): remove 'foo' option
BREAKING CHANGE: The 'foo' option has been removed.
```
如果以下提交和提交 `667ecc1` 在同一个发布版本下,它们不会出现在变更日志中。否则,撤销提交会出现在 "撤销" 标题下。
```
revert: feat(compiler): add 'comments' option
This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
```
### 完整信息格式
提交信息由 **标题**、**正文** 和 **页脚** 组成。标题包含 **类型**、**作用域** 和 **主题**:
```
<type>(<scope>): <subject>
<空行>
<body>
<空行>
<footer>
```
**标题** 是必需的,**作用域** 是可选的。
### 撤销
如果提交撤销了之前的提交,应该以 `revert: ` 开头,后跟被撤销提交的标题。在正文中应该写:`This reverts commit <hash>.`,其中 hash 是被撤销提交的 SHA。
### 类型
如果前缀是 `feat`、`fix` 或 `perf`,它将出现在变更日志中。但如果有任何 [BREAKING CHANGE](#footer),提交将始终出现在变更日志中。
其他前缀可自行决定。建议的前缀有 `docs`、`chore`、`style`、`refactor` 和 `test`,用于与变更日志无关的任务。
### 作用域
作用域可以是指定提交更改位置的任何内容。例如 `dev`、`build`、`workflow`、`cli` 等...
### 主题
主题包含对变更的简洁描述:
- 使用祈使句、现在时:"change" 而不是 "changed" 或 "changes"
- 不要大写第一个字母
- 结尾不要加点 (.)
### 正文
与 **主题** 一样,使用祈使句、现在时:"change" 而不是 "changed" 或 "changes"。正文应包括变更的动机,并将其与之前的行为进行对比。
### 页脚
页脚应包含有关 **破坏性变更** 的任何信息,也是引用此提交 **关闭** 的 GitHub 问题的地方。
**破坏性变更** 应以单词 `BREAKING CHANGE:` 开头,后跟空格或两个换行符。提交信息的其余部分用于此说明。
# 防止在不使用模板的情况下创建问题
blank_issues_enabled: false
checkIssueTemplate: true
checkPullRequestTemplate: true
# 对来自仓库首次贡献者的 PR 发布的评论
newPRWelcomeComment: |
💖 感谢你提交这个拉取请求!💖
请耐心等待,我们会尽快回复你。
# 首次用户合并拉取请求时发布的评论
firstPRMergeComment: >
感谢你的贡献!🎉🎉🎉
# 对首次报告的问题发布的评论
newIssueWelcomeComment: >
感谢你提交第一个问题!请确保遵循问题模板,并提供所有信息来帮助开发者!
# *可选* 检查缺乏描述性的默认标题
# 必须全部小写
requestInfoDefaultTitles:
- update readme.md
- updates
# *必需* 回复的评论
requestInfoReplyComment: >
感谢你提交这个问题/PR!如果你能提供更多信息,我们将不胜感激,这样我们可以更有效地分析上下文中的情况。
# Venus 贡献指南
嗨!我们很高兴你有兴趣为 Venus 做出贡献。在提交你的贡献前,请花点时间阅读以下指南:
- [Pull Request 指南](#pull-request-指南)
## 贡献者行为准则
作为本项目的贡献者和维护者,我们承诺尊重所有通过报告问题、发布功能请求、更新文档、提交拉取请求或补丁以及其他活动来做出贡献的人。
我们致力于让每个人的项目参与都成为一次无骚扰的体验,无论其经验水平、性别、性别认同和表达、性取向、残疾、外观、身体大小、种族、年龄或宗教信仰如何。
参与者不可接受的行为示例包括使用性语言或意象、贬低性评论或人身攻击、骚扰、公开或私下骚扰、侮辱或其他不专业行为。
项目维护者有权删除、编辑或拒绝不符合本行为准则的评论、提交、代码、wiki 编辑、问题和其他贡献。不遵守行为准则的项目维护者可能被从项目团队中移除。
## Pull Request 指南
- 从相关分支(例如 main)检出一个话题分支,并针对该分支进行合并。
- 如果添加新功能:
- 提供一个令人信服的理由来添加此功能。理想情况下,你应该先打开一个建议问题并在处理前获得批准。
- 如果修复 Bug:
- 在 PR 中提供 Bug 的详细描述。最好提供实时演示。
- 在处理 PR 时可以有多个小提交 - GitHub 可以在合并前自动压缩它们。
## 开发设置
你需要 [pnpm](https://pnpm.io/)
克隆仓库后,运行:
```bash
# 安装项目依赖
$ pnpm install
# 启动项目
$ pnpm run dev
```
version: 2
updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
groups:
non-breaking-changes:
update-types: [minor, patch]
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
groups:
non-breaking-changes:
update-types: [minor, patch]
## 描述
<!-- 请根据需要描述变更。如果这是一个功能或增强,请尽可能详细。如果这是一个 Bug 修复,请链接它修复的问题或详细描述该 Bug。
-->
<!-- 你也可以在这里添加其他背景信息 -->
## 变更类型
请删除不相关的选项。
- [ ] Bug 修复(不破坏现有功能的修复)
- [ ] 新功能(不破坏现有功能的新增功能)
- [ ] 破坏性变更(会导致现有功能无法按预期工作的修复或功能)
- [ ] 此变更需要更新文档
- [ ] 请不要修改 `pnpm-lock.yaml`,除非你引入了新的测试示例。
## 检查清单
> ℹ️ 检查所有复选框 - 这表明你已按照 [贡献指南](contributing.md) 中的规则完成了所有操作。
- [ ] 如果引入新功能,请记录文档。你可以使用 `pnpm run docs:dev` 命令运行文档。
- [ ] 使用 `pnpm test` 运行测试。
- [ ] 变更日志由 PR 名称生成。请确保它以可理解的方式解释你的更改。请在变更集消息前加上 `feat:`、`fix:`、`perf:`、`docs:` 或 `chore:` 前缀。
- [ ] 我的代码遵循本项目的样式指南
- [ ] 我已对自己的代码进行了自我审查
- [ ] 我已对我的代码进行了评论,特别是在难以理解的区域
- [ ] 我已对文档进行了相应的更改
- [ ] 我的更改未生成新的警告
- [ ] 我已添加测试来证明我的修复有效或我的功能正常工作
- [ ] 新的和现有的单元测试在本地通过我的更改
- [ ] 任何依赖的更改都已在下游模块中合并和发布
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
version-template: $MAJOR.$MINOR.$PATCH
change-template: '* $TITLE (#$NUMBER) @$AUTHOR'
template: |
# What's Changed
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
categories:
- title: '🚀 Features'
labels:
- 'feature'
- title: '🐞 Bug Fixes'
labels:
- 'bug'
- title: '📈 Performance & Enhancement'
labels:
- 'perf'
- 'enhancement'
- title: 📝 Documentation
labels:
- 'documentation'
- title: 👻 Maintenance
labels:
- 'chore'
- 'dependencies'
# collapse-after: 12
- title: 🚦 Tests
labels:
- 'tests'
- title: 'Breaking'
label: 'breaking'
version-resolver:
major:
labels:
- 'major'
- 'breaking'
minor:
labels:
- 'minor'
patch:
labels:
- 'feature'
- 'patch'
- 'bug'
- 'maintenance'
- 'docs'
- 'dependencies'
- 'security'
exclude-labels:
- 'skip-changelog'
- 'no-changelog'
- 'changelog'
- 'bump versions'
- 'reverted'
- 'invalid'
titleAndCommits: true
types:
- feat
- fix
- docs
- chore
- style
- refactor
- perf
- test
- build
- ci
- revert
# 描述:在多个操作系统上验证 PR 的构建可行性,确保代码在不同平台上都能正确构建。
name: Build detection
# PR 打开、同步或重新打开时
# 仅针对 main 分支
on:
pull_request_target:
types: [opened, synchronize, reopened]
branches:
- main
env:
HUSKY: "0"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
# 1. 检查代码
# 2. 检查出 PR 分支
# 3. 设置 Node 环境
# 4. 执行构建 (pnpm run build)
jobs:
post-update:
if: github.repository == 'monorepo/venus'
# if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
- windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout out pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Build
run: |
pnpm run build
# https://github.com/changesets/action
name: Changeset version
# 自动管理 monorepo 的版本更新,使用 changesets 工具管理语义化版本。
# 触发条件:
# PR 合并到 main 分支时
# 手动触发 (workflow_dispatch)
on:
workflow_dispatch:
pull_request:
types:
- closed
branches:
- main
permissions:
pull-requests: write
contents: write
env:
CI: true
# 1. 检查代码
# 2. 设置 Node 环境
# 3. 执行版本更新命令 (pnpm run version)
# 4. 创建版本更新 PR
# 5. 自动提交 (chore: bump versions)
jobs:
version:
if: (github.event.pull_request.merged || github.event_name == 'workflow_dispatch') && github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'monorepo/venus'
# if: github.repository == 'vbenjs/vue-vben-admin'
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Create Release Pull Request
uses: changesets/action@v1
with:
version: pnpm run version
commit: "chore: bump versions"
title: "chore: bump versions"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: CI
# 当推送/合并到 main或releases/*分支时 执行
# 1. 检查代码 (checkout@v4)
# 2. 安装 pnpm
# 3. 设置 Node 环境
# 4. 安装依赖
# 5. 运行测试
# 6. 构建项目
on:
pull_request:
push:
branches:
- main
- "releases/*"
permissions:
contents: read
env:
CI: true
TZ: Asia/Shanghai
jobs:
test:
name: Test
if: github.repository == 'monorepo/venus'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
- windows-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup Node
uses: ./.github/actions/setup-node
# - name: Check Git version
# run: git --version
# - name: Setup mock Git user
# run: git config --global user.email "you@example.com" && git config --global user.name "Your Name"
- name: Vitest tests
run: pnpm run test:unit
# - name: Upload coverage
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
lint:
name: Lint
if: github.repository == 'monorepo/venus'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
- windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Lint
run: pnpm run lint
check:
name: Check
if: github.repository == 'monorepo/venus'
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
- windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Typecheck
run: pnpm check:type
# From https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions
- name: Check workflow files
if: runner.os == 'Linux'
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color -shellcheck=""
ci-ok:
name: CI OK
if: github.repository == 'monorepo/venus'
runs-on: ubuntu-latest
needs: [test, check, lint]
env:
FAILURE: ${{ contains(join(needs.*.result, ','), 'failure') }}
steps:
- name: Check for failure
run: |
echo $FAILURE
if [ "$FAILURE" = "false" ]; then
exit 0
else
exit 1
fi
# 对于大多数项目而言,此工作流文件无需修改,你只需将其提交至代码仓库即可。
# 你也可以根据需要修改此文件,以此覆盖默认的待分析语言集合,或配置自定义查询语句、构建逻辑。
# ******** 注意事项 ********
# 我们已尝试自动检测你代码仓库中的开发语言。请务必检查下方定义的 language 矩阵,确认其包含的 CodeQL 支持语言集准确无误。
# 使用 GitHub CodeQL 对代码进行静态安全分析,检测潜在的代码漏洞和安全问题。
name: "CodeQL"
# 触发条件:
# 推送到 main 分支
# PR 到 main 分支
# 每周日午夜定时运行(0 35 * * 0)
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "35 0 * * 0"
jobs:
analyze:
name: Analyze (${{ matrix.language }})
if: github.repository == 'monorepo/venus'
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
# security-events: write - 创建安全事件
# packages: read - 读取包
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
# name: Deploy Website on push
# on:
# push:
# branches:
# - main
# jobs:
# deploy-playground-ftp:
# name: Deploy Push Playground Ftp
# if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Sed Config Base
# shell: bash
# run: |
# sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./playground/.env.production
# sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./playground/.env.production
# cat ./playground/.env.production
# - name: Setup Node
# uses: ./.github/actions/setup-node
# - name: Build
# run: pnpm build:play
# - name: Sync Playground files
# uses: SamKirkland/FTP-Deploy-Action@v4.3.6
# with:
# server: ${{ secrets.PRO_FTP_HOST }}
# username: ${{ secrets.WEB_PLAYGROUND_FTP_ACCOUNT }}
# password: ${{ secrets.WEB_PLAYGROUND_FTP_PWSSWORD }}
# local-dir: ./playground/dist/
# deploy-antd-ftp:
# name: Deploy Push Antd Ftp
# if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Sed Config Base
# shell: bash
# run: |
# sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-antd/.env.production
# sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-antd/.env.production
# cat ./apps/web-antd/.env.production
# - name: Setup Node
# uses: ./.github/actions/setup-node
# - name: Build
# run: pnpm run build:antd
# - name: Sync files
# uses: SamKirkland/FTP-Deploy-Action@v4.3.6
# with:
# server: ${{ secrets.PRO_FTP_HOST }}
# username: ${{ secrets.WEB_ANTD_FTP_ACCOUNT }}
# password: ${{ secrets.WEB_ANTD_FTP_PASSWORD }}
# local-dir: ./apps/web-antd/dist/
# rerun-on-failure:
# name: Rerun on failure
# needs:
# - deploy-playground-ftp
# - deploy-docs-ftp
# - deploy-antd-ftp
# - deploy-ele-ftp
# - deploy-naive-ftp
# if: failure() && fromJSON(github.run_attempt) < 10
# runs-on: ubuntu-latest
# steps:
# - name: Retry ${{ fromJSON(github.run_attempt) }} of 10
# env:
# GH_REPO: ${{ github.repository }}
# GH_TOKEN: ${{ github.token }}
# run: gh workflow run rerun.yml -F run_id=${{ github.run_id }}
name: Release Drafter
# 自动生成发布说明(Release Notes),基于 PR 标签和信息。
# 推送到 main 分支时
on:
push:
branches:
- main
permissions:
contents: read
pull-requests: write
# 自动化生成发布说明
# 基于 PR 自动分类更改
# 简化发布流程
jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
if: github.repository == 'vbenjs/vue-vben-admin'
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # 每天零点运行一次,它会检查所有带有 "need reproduction" 标签的 Issues。如果这些 Issues 在过去的 3 天内没有任何活动,它们将会被自动关闭。这有助于保持 Issue 列表的整洁,并且提醒用户在必要时提供更多的信息。
# name: Issue Close Require
# # 触发条件:每天零点
# on:
# workflow_dispatch:
# schedule:
# - cron: '0 0 * * *'
# permissions:
# pull-requests: write
# contents: write
# issues: write
# jobs:
# close-issues:
# if: github.repository == 'vbenjs/vue-vben-admin'
# runs-on: ubuntu-latest
# steps:
# # 关闭未活动的 Issues
# - name: Close Inactive Issues
# uses: actions/stale@v9
# with:
# days-before-stale: -1 # Issues and PR will never be flagged stale automatically.
# stale-issue-label: needs-reproduction # Label that flags an issue as stale.
# only-labels: needs-reproduction # Only process these issues
# days-before-issue-close: 3
# ignore-updates: true
# remove-stale-when-updated: false
# close-issue-message: This issue was closed because it was open for 3 days without a valid reproduction.
# close-issue-label: closed-by-action
# name: Label Based Actions
# on:
# issues:
# types: [labeled]
# # pull_request:
# # types: [labeled]
# permissions:
# issues: write
# pull-requests: write
# contents: write
# jobs:
# reply-labeled:
# if: github.repository == 'vbenjs/vue-vben-admin'
# runs-on: ubuntu-latest
# steps:
# - name: remove enhancement pending
# if: github.event.label.name == 'enhancement'
# uses: actions-cool/issues-helper@v3
# with:
# actions: 'remove-labels'
# token: ${{ secrets.GITHUB_TOKEN }}
# issue-number: ${{ github.event.issue.number }}
# labels: 'enhancement: pending triage'
# - name: remove bug pending
# if: github.event.label.name == 'bug'
# uses: actions-cool/issues-helper@v3
# with:
# actions: 'remove-labels'
# token: ${{ secrets.GITHUB_TOKEN }}
# issue-number: ${{ github.event.issue.number }}
# labels: 'bug: pending triage'
# - name: needs reproduction
# if: github.event.label.name == 'needs reproduction'
# uses: actions-cool/issues-helper@v3
# with:
# actions: 'create-comment, remove-labels'
# token: ${{ secrets.GITHUB_TOKEN }}
# issue-number: ${{ github.event.issue.number }}
# body: |
# Hello @${{ github.event.issue.user.login }}. Please provide the complete reproduction steps and code. Issues labeled by `needs reproduction` will be closed if no activities in 3 days.
# labels: 'bug: pending triage'
# name: Lock Threads
# on:
# schedule:
# - cron: "0 0 * * *"
# workflow_dispatch:
# permissions:
# issues: write
# pull-requests: write
# jobs:
# action:
# if: github.repository == 'vbenjs/vue-vben-admin'
# runs-on: ubuntu-latest
# steps:
# - uses: dessant/lock-threads@v5
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# issue-inactive-days: "14"
# issue-lock-reason: ""
# pr-inactive-days: "30"
# pr-lock-reason: ""
# process-only: "issues, prs"
name: Create Release Tag
# 测版本标签推送事件,触发发布流程。
on:
push:
tags:
- "v*.*.*" # Push events to matching v*, i.e. v1.0, v20.15.10
env:
HUSKY: "0"
permissions:
pull-requests: write
contents: write
# 触发条件:
# 推送版本标签,格式:v*.*.*
# 示例:v1.0.0、v20.15.10
# 1. 检查代码
# 2. 执行构建
# 3. 运行测试
# 4. 创建发布
jobs:
build:
name: Create Release
if: github.repository == 'monorepo/venus'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Install pnpm
# uses: pnpm/action-setup@v4
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
# cache: "pnpm"
# - name: Install dependencies
# run: pnpm install --frozen-lockfile
# - name: Test and Build
# run: |
# pnpm run test
# pnpm run build
- name: version
id: version
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=${tag#v}
major=${version%%.*}
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT
echo "major=${major}" >> $GITHUB_OUTPUT
- uses: release-drafter/release-drafter@v6
with:
version: ${{ steps.version.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: force update major tag
# run: |
# git tag v${{ steps.version.outputs.major }} ${{ steps.version.outputs.tag }} -f
# git push origin refs/tags/v${{ steps.version.outputs.major }} -f
# - name: Create Release for Tag
# id: release_tag
# uses: ncipollo/release-action@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# generateReleaseNotes: "true"
# body: |
# > Please refer to [CHANGELOG.md](https://github.com/vbenjs/vue-vben-admin/blob/main/CHANGELOG.md) for details.
# name: Rerun workflow
# on:
# workflow_dispatch:
# inputs:
# run_id:
# description: The workflow id to relanch
# required: true
# jobs:
# rerun:
# runs-on: ubuntu-latest
# steps:
# - name: rerun ${{ inputs.run_id }}
# env:
# GH_REPO: ${{ github.repository }}
# GH_TOKEN: ${{ github.token }}
# run: |
# gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
# gh run rerun ${{ inputs.run_id }} --failed
name: Semantic Pull Request
# 验证 PR 标题是否符合语义化提交规范,确保提交信息的一致性。
# 保证提交信息格式一致
# 便于自动生成 CHANGELOG
# 提高代码库可读性
# 触发条件:
# PR 打开、编辑或同步时
on:
pull_request_target:
types:
- opened
- edited
- synchronize
# 首字母:主体首字母不能大写
# 允许的类型:
jobs:
main:
name: Semantic Pull Request
if: github.repository == 'vbenjs/vue-vben-admin'
runs-on: ubuntu-latest
steps:
- name: Validate PR title
uses: amannn/action-semantic-pull-request@v5
with:
wip: true
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
requireScope: false
types: |
fix
feat
docs
style
refactor
perf
test
build
ci
chore
revert
types
release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: "Close stale issues"
# 自动关闭长时间无活动的 Issue 和 PR,保持项目的活跃度。
on:
schedule:
- cron: "0 1 * * *"
jobs:
stale:
if: github.repository == 'monorepo/venus'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days"
stale-pr-message: "This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days"
exempt-issue-labels: "bug,enhancement"
days-before-stale: 60
days-before-close: 7
...@@ -14,5 +14,5 @@ declare global { ...@@ -14,5 +14,5 @@ declare global {
__POWERED_BY_QIANKUN__?: boolean; __POWERED_BY_QIANKUN__?: boolean;
} }
} }
sss
export {}; export {};
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
"format": "vsh lint --format", "format": "vsh lint --format",
"lint": "vsh lint", "lint": "vsh lint",
"postinstall": "pnpm -r run stub --if-present", "postinstall": "pnpm -r run stub --if-present",
"preinstall": "npx only-allow pnpm", "preinstall": "npx only-allow pnpm",
"preview": "turbo-run preview", "preview": "turbo-run preview",
"publint": "vsh publint", "publint": "vsh publint",
...@@ -80,7 +79,6 @@ ...@@ -80,7 +79,6 @@
"cross-env": "catalog:", "cross-env": "catalog:",
"cspell": "catalog:", "cspell": "catalog:",
"happy-dom": "catalog:", "happy-dom": "catalog:",
"husky": "^9.1.7",
"lefthook": "catalog:", "lefthook": "catalog:",
"lint-staged": "^16.2.7", "lint-staged": "^16.2.7",
"playwright": "catalog:", "playwright": "catalog:",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!