chore: initial commit (#2906)

This commit is contained in:
贤心
2025-11-04 15:09:10 +08:00
committed by GitHub
parent 9e61ad04d9
commit 9ef38d8eeb
291 changed files with 160952 additions and 47199 deletions

View File

@@ -1,6 +1,6 @@
name: 😄 创建议题
description: 此处只受理 Bug 报告、功能请求。若是其他业务相关的问题建议在 Discussions 寻求社区帮助。
title: "[组件名称] 描述问题的标题"
title: '[组件名称] 描述问题的标题'
body:
- type: markdown
attributes:

View File

@@ -12,7 +12,6 @@
- 在此处列出本次 PR 的每一项改动内容
### ✅ 本次 PR 的满足条件
> 请在申请合并之前,将符合条件的每一项进行勾选

38
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: CI
on:
pull_request:
push:
branches:
- main
- '*.x-stable'
jobs:
lint:
name: Lint code
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Check formatting with Prettier
run: |
npx prettier --write --log-level=warn .
git --no-pager diff --exit-code
- name: Lint code with ESLint
run: npx eslint .
# 串行运行测试
- name: Run tests with Jest
run: npx jest --ci --runInBand

View File

@@ -2,7 +2,7 @@ name: Issue Close Require
on:
schedule:
- cron: "0 0 * * *"
- cron: '0 0 * * *'
permissions:
contents: read

View File

@@ -21,11 +21,11 @@ jobs:
issue_number: context.issue.number,
};
const issue = await github.rest.issues.get(config);
// 是否带有 `bug`, `wontfix` 标签
const hasBugLabel = issue.data.labels.some(label => label.name === 'bug');
const hasWontfixLabel = issue.data.labels.some(label => label.name === 'wontfix');
// 对带有 `bug` 标签的 issue 追加 `resolved` 标签,表示 bug 已解决。
if (hasBugLabel && !hasWontfixLabel) {
github.rest.issues.addLabels({

View File

@@ -41,7 +41,7 @@ jobs:
@${{ github.event.issue.user.login }} 你好,为了提升沟通效率,我们对 Issue 制定了严格的要求,你的 Issue 因不符合规定而被自动关闭。
建议你在下次创建 Issue 时,遵循相应规范和社区行为准则。谢谢。
> ${{ steps.template.outputs.CONTRIBUTING }}
- name: need reproduce
if: github.event.label.name == 'need reproduce'
uses: actions-cool/issues-helper@v3
@@ -68,7 +68,7 @@ jobs:
- 通过其他技术社区搜索相关资料、或充分利用当前主流的人工智能大模型
- [Discussions](https://github.com/layui/layui/discussions)
> ${{ steps.template.outputs.CONTRIBUTING }}
- name: unrelated
if: github.event.label.name == 'unrelated'
uses: actions-cool/issues-helper@v3

View File

@@ -7,12 +7,12 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup node
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
- name: Install dependencies
run: npm install
@@ -20,4 +20,4 @@ jobs:
- name: Build
run: npm run build
- run: npx pkg-pr-new publish --template './examples/pr-preview'
- run: npx pkg-pr-new publish --template './tests/visual/template/pr-preview'

View File

@@ -11,7 +11,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
env:
NODE_ENV: development
- name: Get the version
id: get_version
@@ -28,13 +39,13 @@ jobs:
# 按日期排序标签,获取上一个标签
PREVIOUS_TAG=$(git for-each-ref --sort=-creatordate --format '%(refname:short)' refs/tags | sed -n 2p)
# 获取当前标签
CURRENT_TAG=${GITHUB_REF#refs/tags/}
echo "Previous Tag: $PREVIOUS_TAG"
echo "Current Tag: $CURRENT_TAG"
for COMMIT_SHA in $(git log ${PREVIOUS_TAG}...$CURRENT_TAG --pretty=format:"%H")
do
USER=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
@@ -61,14 +72,10 @@ jobs:
- name: Create Zip File
id: asset
run: |
DIR_NAME="layui-${{ env.VERSION }}"
mkdir -p $DIR_NAME/layui
mv dist layui
mv layui $DIR_NAME/
mv examples/introduce/* $DIR_NAME/
7z a $DIR_NAME.zip $DIR_NAME
npm run release
DIR_NAME="release/assets/layui-${{ env.VERSION }}"
echo "filename=$DIR_NAME" >> $GITHUB_OUTPUT
- name: GH Release
id: create_release
uses: softprops/action-gh-release@v2
@@ -76,7 +83,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: |
- **更新日志**: https://layui.dev/docs/2/versions.html#${{ env.VERSION }}
- **更新日志**: https://layui.dev/docs/3/versions.html#${{ env.VERSION }}
- **本次贡献**: ${{ steps.contributors.outputs.usernames }} 🎉
prerelease: ${{ steps.prerelease.outputs.prerelease }}
files: ${{ steps.asset.outputs.filename }}.zip