18 Commits

Author SHA1 Message Date
windychen 562b73f560 chore: 更新小版本 1.1.4 → 1.1.5
Node.js Build / build (push) Successful in 8s
2026-07-16 14:07:01 +08:00
windychen 88eef2e8a4 chore: 钉钉通知增加发布结果详情(skip/publish/fail)
Node.js Build / build (push) Successful in 7s
2026-07-16 11:12:49 +08:00
windychen b849da3ec0 Revert "test: 真正的语法错误,测试CI失败通知"
Node.js Build / build (push) Successful in 8s
2026-07-16 11:09:40 +08:00
windychen e039433754 test: 真正的语法错误,测试CI失败通知
Node.js Build / build (push) Failing after 5s
2026-07-16 11:09:16 +08:00
windychen 711a0d1793 test: 故意引入语法错误,测试CI失败通知
Node.js Build / build (push) Successful in 6s
2026-07-16 11:08:33 +08:00
windychen 6397d2e3d0 chore: Publish 步骤增加版本去重检查 + 钉钉通知
Node.js Build / build (push) Successful in 9s
2026-07-16 11:04:33 +08:00
windychen 9b3e8e9bc6 chore: 更新小版本
Node.js Build / build (push) Successful in 8s
2026-07-15 17:48:50 +08:00
windychen 8cac0f3d60 fix: 修复浏览器引入时better-sqlite3依赖引发的报错
Node.js Build / build (push) Failing after 20s
2026-07-15 17:48:00 +08:00
windychen e19f38d9eb chore: 更新小版本
Node.js Build / build (push) Successful in 6s
2026-06-23 21:33:47 +08:00
windychen 108ab063ef 更新 README.md
Node.js Build / build (push) Failing after 19s
2026-06-23 21:32:35 +08:00
windychen 1220fafc61 chore: 修正包名单词问题
Node.js Build / build (push) Successful in 8s
2026-06-08 17:02:58 +08:00
windychen0 20338b7722 chore: 尝试去除 actions/checkout 的无效步骤
Node.js Build / build (push) Successful in 15s
2026-06-06 20:21:10 +08:00
windychen0 b894041def chore: 尝试去除 actions/checkout 的无效步骤
Node.js Build / build (push) Failing after 0s
2026-06-06 20:19:56 +08:00
windychen0 0aa5c3d990 chore: 尝试去除 actions/checkout 的无效步骤
Node.js Build / build (push) Failing after 0s
2026-06-06 20:17:36 +08:00
windychen0 820c9e272c chore: 尝试去除 actions/checkout 的无效步骤
Node.js Build / build (push) Failing after 0s
2026-06-06 20:16:52 +08:00
windychen0 0739a7eefc fix-ai: 修复引入node模块导致的打包问题
Node.js Build / build (push) Failing after 5s
2026-06-06 20:11:41 +08:00
windychen0 186a4bc48c chore: 更新功能版本
Node.js Build / build (push) Failing after 49s
2026-06-06 19:52:08 +08:00
windychen0 3994bca0ab feat-ai(storage.js): 添加nodejs环境下的sqlite存储支持,调用方法与浏览器环境下保存一致 2026-06-06 19:51:30 +08:00
2 changed files with 46 additions and 97 deletions
+24 -71
View File
@@ -3,11 +3,12 @@ name: Node.js Build
on:
push:
branches: ["main", "master"]
pull_request:
branches: ["main", "master"]
jobs:
build:
if: contains(github.event.head_commit.message, 'chore') && contains(github.event.head_commit.message, '版本') && contains(github.event.head_commit.message, '更新')
runs-on: docker
runs-on: docker # 匹配你 runner 的标签
steps:
- name: Checkout code
run: |
@@ -27,96 +28,48 @@ jobs:
- name: Run build
run: npm run build
- name: Publish to Verdaccio
id: publish-verdaccio
- name: Publish package
id: publish
run: |
VERSION=$(node -p "require('./package.json').version")
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://verdaccio:4873/windychen-utils/$VERSION)
if [ "$HTTP_CODE" = "200" ]; then
echo "Verdaccio: version $VERSION already exists, skipping."
echo "verdaccio_result=skipped|版本 ${VERSION} 已存在" >> $GITHUB_OUTPUT
echo "Version $VERSION already exists in Verdaccio, skipping publish."
echo "skipped|版本 ${VERSION} 已存在,跳过发布" > /tmp/publish_result.txt
else
echo "Version $VERSION not found, publishing..."
if npm publish 2>&1; then
echo "verdaccio_result=published|已发布 v${VERSION}" >> $GITHUB_OUTPUT
echo "published|已发布 v${VERSION} 到 Verdaccio" > /tmp/publish_result.txt
else
echo "verdaccio_result=failed|发布失败" >> $GITHUB_OUTPUT
echo "failed|npm publish 失败 (v${VERSION})" > /tmp/publish_result.txt
exit 1
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
if: always()
run: |
STATUS="${{ job.status }}"
VERSION=$(node -p "require('./package.json').version")
parse_result() {
local raw="$1"
local target="$2"
local icon="${raw%%|*}"
local detail="${raw#*|}"
case "$icon" in
published) echo "📦 ${target}: ${detail}" ;;
skipped) echo "⏭️ ${target}: ${detail}" ;;
failed) echo "❌ ${target}: ${detail}" ;;
*) echo "⚠️ ${target}: ${detail}" ;;
if [ -f /tmp/publish_result.txt ]; then
PUBLISH_RAW=$(cat /tmp/publish_result.txt)
PUBLISH_ICON=$(echo "$PUBLISH_RAW" | cut -d'|' -f1)
PUBLISH_DETAIL=$(echo "$PUBLISH_RAW" | cut -d'|' -f2)
else
PUBLISH_ICON="skipped"
PUBLISH_DETAIL="构建失败,未执行发布"
fi
case "$PUBLISH_ICON" in
published) PUB_LINE="📦 发布: ${PUBLISH_DETAIL}" ;;
skipped) PUB_LINE="⏭️ 发布: ${PUBLISH_DETAIL}" ;;
failed) PUB_LINE="❌ 发布: ${PUBLISH_DETAIL}" ;;
*) PUB_LINE="⚠️ 发布: ${PUBLISH_DETAIL}" ;;
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
TITLE="✅ windychen-utils v${VERSION} 构建完成 chen-fnos"
else
TITLE="❌ windychen-utils v${VERSION} 构建失败 chen-fnos"
fi
curl -s -X POST "https://oapi.dingtalk.com/robot/send?access_token=${{ secrets.DINGDING_TOKEN }}" \
-H "Content-Type: application/json" \
-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 }}\"}}"
-d "{\"msgtype\":\"markdown\",\"markdown\":{\"title\":\"${TITLE}\",\"text\":\"## ${TITLE}\n\n${PUB_LINE}\n\n- 仓库: windychen/windyChenUtils\n- 分支: ${{ github.ref_name }}\n- 提交: ${{ github.sha }}\"}}"
+1 -5
View File
@@ -1,6 +1,6 @@
{
"name": "windychen-utils",
"version": "1.1.12",
"version": "1.1.5",
"main": "dist/windychen-utils.cjs.js",
"module": "dist/windychen-utils.esm.js",
"browser": "dist/windychen-utils.js",
@@ -15,10 +15,6 @@
"author": "windychen",
"license": "ISC",
"description": "",
"repository": {
"type": "git",
"url": "http://gitea.windychen00n.work/windychen/windyChenUtils.git"
},
"devDependencies": {
"webpack": "^5.90.0",
"webpack-cli": "^5.1.4"