仓库自包含化:CI/文档/规范入库,升级 echarts,填关于页链接
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
name: CI
|
||||
|
||||
# 仅分支推送触发:tag 推送交给 release.yml;solo 开发不走 PR,去掉 pull_request 避免同一提交双跑
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest-amd64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24"
|
||||
cache: npm
|
||||
- name: 安装依赖
|
||||
run: npm ci
|
||||
- name: ESLint(检查模式)
|
||||
run: npx eslint .
|
||||
- name: 类型检查
|
||||
run: npm run typecheck
|
||||
- name: 构建
|
||||
run: npm run build
|
||||
@@ -0,0 +1,34 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest-amd64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24"
|
||||
cache: npm
|
||||
|
||||
- name: 构建并打包 dist.zip
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
cd dist && zip -qr ../dist.zip . && cd ..
|
||||
|
||||
- name: 提取 CHANGELOG 版本段作为 Release 描述
|
||||
run: |
|
||||
TAG="${{ gitea.ref_name }}"
|
||||
awk -v ver="${TAG#v}" '$0 ~ "^## \\[" ver "\\]" {flag=1; next} /^## \[/ && flag {exit} flag {print}' CHANGELOG.md > release-notes.md
|
||||
[ -s release-notes.md ] || echo "Release ${TAG}" > release-notes.md
|
||||
|
||||
- name: 创建 Release 并上传 dist.zip(重跑幂等,同名附件自动替换)
|
||||
uses: https://gitea.com/actions/gitea-release-action@v1
|
||||
with:
|
||||
token: ${{ secrets.BUILD_TOKEN }}
|
||||
body_path: release-notes.md
|
||||
files: dist.zip
|
||||
Reference in New Issue
Block a user