28 Commits

Author SHA1 Message Date
windychen f3d2b3ff7e chore: workflow 版本 fix pipefail + step outputs 更新
Node.js Build / build (push) Successful in 9s
2026-07-21 00:19:34 +08:00
windychen 9b4a9ea97d chore: fix grep pipefail 版本 更新
Node.js Build / build (push) Failing after 10s
2026-07-21 00:16:40 +08:00
windychen 9223f3c5ff chore: bump 版本 to 1.1.10 更新
Node.js Build / build (push) Failing after 8s
2026-07-21 00:13:31 +08:00
windychen 3be193f8c4 chore: bump 版本 to 1.1.9 更新
Node.js Build / build (push) Failing after 12s
2026-07-21 00:10:41 +08:00
windychen d6d06e90a6 fix: Gitea 版本检查改用 packages API,Release 增加去重
Node.js Build / build (push) Has been skipped
2026-07-16 14:30:54 +08:00
windychen ed4f144e26 chore: 更新小版本发布流程,CI 新增自动创建 Gitea Release
Node.js Build / build (push) Failing after 8s
2026-07-16 14:29:36 +08:00
windychen cde9795307 chore: 更新小版本 1.1.7 → 1.1.8,CI 新增 Gitea 推送
Node.js Build / build (push) Successful in 9s
2026-07-16 14:26:25 +08:00
windychen 54c2fc1de8 chore: 更新小版本 1.1.6 → 1.1.7,添加 repository 字段关联 Gitea
Node.js Build / build (push) Successful in 9s
2026-07-16 14:23:00 +08:00
windychen 52cf3c36ea chore: 更新小版本 1.1.5 → 1.1.6
Node.js Build / build (push) Successful in 6s
2026-07-16 14:13:42 +08:00
windychen f27b9690df chore: workflow 仅当提交信息含 chore+版本+更新 时触发
Node.js Build / build (push) Successful in 9s
2026-07-16 14:12:23 +08:00
windychen 4ee2bc52b1 chore: 更新小版本 1.1.4 → 1.1.5
Node.js Build / build (push) Successful in 8s
2026-07-16 14:09:28 +08:00
windychen 84c4cd96da chore: 钉钉通知增加发布结果详情(skip/publish/fail) 2026-07-16 14:09:28 +08:00
windychen 2ca0093ae6 Revert "test: 真正的语法错误,测试CI失败通知" 2026-07-16 14:09:28 +08:00
windychen 0c3670f710 test: 真正的语法错误,测试CI失败通知 2026-07-16 14:09:28 +08:00
windychen a0a912828c test: 故意引入语法错误,测试CI失败通知 2026-07-16 14:09:28 +08:00
windychen ce8c36ae0f chore: Publish 步骤增加版本去重检查 + 钉钉通知 2026-07-16 14:09:28 +08:00
windychen cacb5fae5c chore: 更新小版本 2026-07-16 14:09:28 +08:00
windychen c16694f390 fix: 修复浏览器引入时better-sqlite3依赖引发的报错 2026-07-16 14:09:28 +08:00
windychen 7faf2928eb chore: 更新小版本 2026-07-16 14:09:28 +08:00
windychen 9468f51c2a docs: 更新 README.md 2026-07-16 14:09:28 +08:00
windychen 94969d412f chore: 修正包名单词问题 2026-07-16 14:09:28 +08:00
windychen0 4c113be4f0 chore: 尝试去除 actions/checkout 的无效步骤 2026-07-16 14:09:28 +08:00
windychen0 7de6bcdeed chore: 尝试去除 actions/checkout 的无效步骤 2026-07-16 14:09:28 +08:00
windychen0 9e95a75ce1 chore: 尝试去除 actions/checkout 的无效步骤 2026-07-16 14:09:28 +08:00
windychen0 560ab99d2d chore: 尝试去除 actions/checkout 的无效步骤 2026-07-16 14:09:28 +08:00
windychen0 ce90016b0f fix(ai): 修复引入node模块导致的打包问题 2026-07-16 14:09:28 +08:00
windychen0 27c5d9f5b9 chore: 更新功能版本 2026-07-16 14:09:28 +08:00
windychen0 bf4fb2d643 feat(ai)(storage): 添加nodejs环境下的sqlite存储支持,调用方法与浏览器环境下保存一致 2026-07-16 14:09:28 +08:00
2 changed files with 97 additions and 46 deletions
+71 -24
View File
@@ -3,12 +3,11 @@ name: Node.js Build
on: on:
push: push:
branches: ["main", "master"] branches: ["main", "master"]
pull_request:
branches: ["main", "master"]
jobs: jobs:
build: build:
runs-on: docker # 匹配你 runner 的标签 if: contains(github.event.head_commit.message, 'chore') && contains(github.event.head_commit.message, '版本') && contains(github.event.head_commit.message, '更新')
runs-on: docker
steps: steps:
- name: Checkout code - name: Checkout code
run: | run: |
@@ -28,48 +27,96 @@ jobs:
- name: Run build - name: Run build
run: npm run build run: npm run build
- name: Publish package - name: Publish to Verdaccio
id: publish id: publish-verdaccio
run: | run: |
VERSION=$(node -p "require('./package.json').version") VERSION=$(node -p "require('./package.json').version")
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://verdaccio:4873/windychen-utils/$VERSION) HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://verdaccio:4873/windychen-utils/$VERSION)
if [ "$HTTP_CODE" = "200" ]; then if [ "$HTTP_CODE" = "200" ]; then
echo "Version $VERSION already exists in Verdaccio, skipping publish." echo "Verdaccio: version $VERSION already exists, skipping."
echo "skipped|版本 ${VERSION} 已存在,跳过发布" > /tmp/publish_result.txt echo "verdaccio_result=skipped|版本 ${VERSION} 已存在" >> $GITHUB_OUTPUT
else else
echo "Version $VERSION not found, publishing..."
if npm publish 2>&1; then if npm publish 2>&1; then
echo "published|已发布 v${VERSION} 到 Verdaccio" > /tmp/publish_result.txt echo "verdaccio_result=published|已发布 v${VERSION}" >> $GITHUB_OUTPUT
else else
echo "failed|npm publish 失败 (v${VERSION})" > /tmp/publish_result.txt echo "verdaccio_result=failed|发布失败" >> $GITHUB_OUTPUT
exit 1 exit 1
fi fi
fi fi
- name: Publish to Gitea
id: publish-gitea
run: |
npm config set //gitea:3000/api/packages/windychen/npm/:_authToken ${{ secrets.NPM_GITEA_TOKEN }}
VERSION=$(node -p "require('./package.json').version")
EXISTS=$(curl -s "http://gitea:3000/api/v1/packages/windychen?q=windychen-utils" -H "Authorization: token ${{ secrets.NPM_GITEA_TOKEN }}" | grep -c "\"version\":\"$VERSION\"" || true)
if [ "$EXISTS" -gt 0 ]; then
echo "Gitea: version $VERSION already exists, skipping."
echo "gitea_result=skipped|版本 ${VERSION} 已存在" >> $GITHUB_OUTPUT
else
if npm publish --registry http://gitea:3000/api/packages/windychen/npm/ 2>&1; then
echo "gitea_result=published|已发布 v${VERSION}" >> $GITHUB_OUTPUT
else
echo "gitea_result=failed|发布失败" >> $GITHUB_OUTPUT
exit 1
fi
fi
- name: Create Gitea Release
if: always() && steps.publish-gitea.outcome == 'success'
run: |
VERSION=$(node -p "require('./package.json').version")
EXISTS=$(curl -s "http://gitea:3000/api/v1/repos/windychen/windyChenUtils/releases/tags/v${VERSION}" -H "Authorization: token ${{ secrets.NPM_GITEA_TOKEN }}" | grep -c "\"tag_name\"" || true)
if [ "$EXISTS" = "0" ]; then
curl -s -X POST \
"http://gitea:3000/api/v1/repos/windychen/windyChenUtils/releases" \
-H "Authorization: token ${{ secrets.NPM_GITEA_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"v${VERSION}\",\"name\":\"v${VERSION}\",\"body\":\"## windychen-utils v${VERSION}\n\n- 发布到 Verdaccio\n- 发布到 Gitea Packages\",\"target_commitish\":\"main\"}"
else
echo "Release v${VERSION} already exists, skipping."
fi
- name: Notify DingTalk - name: Notify DingTalk
if: always() if: always()
run: | run: |
STATUS="${{ job.status }}" STATUS="${{ job.status }}"
VERSION=$(node -p "require('./package.json').version") VERSION=$(node -p "require('./package.json').version")
if [ -f /tmp/publish_result.txt ]; then
PUBLISH_RAW=$(cat /tmp/publish_result.txt) parse_result() {
PUBLISH_ICON=$(echo "$PUBLISH_RAW" | cut -d'|' -f1) local raw="$1"
PUBLISH_DETAIL=$(echo "$PUBLISH_RAW" | cut -d'|' -f2) local target="$2"
else local icon="${raw%%|*}"
PUBLISH_ICON="skipped" local detail="${raw#*|}"
PUBLISH_DETAIL="构建失败,未执行发布" case "$icon" in
fi published) echo "📦 ${target}: ${detail}" ;;
case "$PUBLISH_ICON" in skipped) echo "⏭️ ${target}: ${detail}" ;;
published) PUB_LINE="📦 发布: ${PUBLISH_DETAIL}" ;; failed) echo "❌ ${target}: ${detail}" ;;
skipped) PUB_LINE="⏭️ 发布: ${PUBLISH_DETAIL}" ;; *) echo "⚠️ ${target}: ${detail}" ;;
failed) PUB_LINE="❌ 发布: ${PUBLISH_DETAIL}" ;;
*) PUB_LINE="⚠️ 发布: ${PUBLISH_DETAIL}" ;;
esac esac
}
VERD_RESULT="${{ steps.publish-verdaccio.outputs.verdaccio_result }}"
GITEA_RESULT="${{ steps.publish-gitea.outputs.gitea_result }}"
if [ -n "$VERD_RESULT" ]; then
VERD_LINE=$(parse_result "$VERD_RESULT" "Verdaccio")
else
VERD_LINE="⚠️ Verdaccio: 未执行"
fi
if [ -n "$GITEA_RESULT" ]; then
GITEA_LINE=$(parse_result "$GITEA_RESULT" "Gitea")
else
GITEA_LINE="⚠️ Gitea: 未执行"
fi
if [ "$STATUS" = "success" ]; then if [ "$STATUS" = "success" ]; then
TITLE="✅ windychen-utils v${VERSION} 构建完成 chen-fnos" TITLE="✅ windychen-utils v${VERSION} 构建完成 chen-fnos"
else else
TITLE="❌ windychen-utils v${VERSION} 构建失败 chen-fnos" TITLE="❌ windychen-utils v${VERSION} 构建失败 chen-fnos"
fi fi
curl -s -X POST "https://oapi.dingtalk.com/robot/send?access_token=${{ secrets.DINGDING_TOKEN }}" \ curl -s -X POST "https://oapi.dingtalk.com/robot/send?access_token=${{ secrets.DINGDING_TOKEN }}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{\"msgtype\":\"markdown\",\"markdown\":{\"title\":\"${TITLE}\",\"text\":\"## ${TITLE}\n\n${PUB_LINE}\n\n- 仓库: windychen/windyChenUtils\n- 分支: ${{ github.ref_name }}\n- 提交: ${{ github.sha }}\"}}" -d "{\"msgtype\":\"markdown\",\"markdown\":{\"title\":\"${TITLE}\",\"text\":\"## ${TITLE}\n\n${VERD_LINE}\n${GITEA_LINE}\n\n- 仓库: windychen/windyChenUtils\n- 分支: ${{ github.ref_name }}\n- 提交: ${{ github.sha }}\"}}"
+5 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "windychen-utils", "name": "windychen-utils",
"version": "1.1.5", "version": "1.1.12",
"main": "dist/windychen-utils.cjs.js", "main": "dist/windychen-utils.cjs.js",
"module": "dist/windychen-utils.esm.js", "module": "dist/windychen-utils.esm.js",
"browser": "dist/windychen-utils.js", "browser": "dist/windychen-utils.js",
@@ -15,6 +15,10 @@
"author": "windychen", "author": "windychen",
"license": "ISC", "license": "ISC",
"description": "", "description": "",
"repository": {
"type": "git",
"url": "http://gitea.windychen00n.work/windychen/windyChenUtils.git"
},
"devDependencies": { "devDependencies": {
"webpack": "^5.90.0", "webpack": "^5.90.0",
"webpack-cli": "^5.1.4" "webpack-cli": "^5.1.4"