mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
chore: 修改发布流程
This commit is contained in:
1 parent
878d120fb0
commit
f84eeb9b38
4 files changed
+74
-3
No files matched your search
@@ -136,6 +136,11 @@ jobs:
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # 获取完整历史用于生成 changelog
|
||||
|
||||
- name: Download macOS artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -151,11 +156,77 @@ jobs:
|
||||
- name: List files
|
||||
run: ls -la dist/
|
||||
|
||||
- name: Generate Release Notes
|
||||
id: release_notes
|
||||
run: |
|
||||
# 获取当前版本号
|
||||
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
||||
CURRENT_VERSION="v${{ inputs.version }}"
|
||||
else
|
||||
CURRENT_VERSION="${{ github.ref_name }}"
|
||||
fi
|
||||
VERSION_NUMBER="${CURRENT_VERSION#v}"
|
||||
|
||||
echo "Current version: $CURRENT_VERSION"
|
||||
|
||||
# 获取上一个 tag
|
||||
PREVIOUS_TAG=$(git tag --sort=-creatordate | grep -v "^${CURRENT_VERSION}$" | head -n 1)
|
||||
|
||||
if [ -z "$PREVIOUS_TAG" ]; then
|
||||
echo "No previous tag found, using first commit"
|
||||
COMMIT_RANGE="HEAD"
|
||||
else
|
||||
echo "Previous tag: $PREVIOUS_TAG"
|
||||
COMMIT_RANGE="${PREVIOUS_TAG}..HEAD"
|
||||
fi
|
||||
|
||||
# 生成 release notes
|
||||
{
|
||||
echo "## 更新内容"
|
||||
echo ""
|
||||
|
||||
# 提取 feat commits
|
||||
FEATS=$(git log $COMMIT_RANGE --pretty=format:"%s" --grep="^feat" 2>/dev/null | sed 's/^feat[:(]//' | sed 's/^[^)]*): //' | sed 's/^/- ✨ /')
|
||||
if [ -n "$FEATS" ]; then
|
||||
echo "### 新功能"
|
||||
echo "$FEATS"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# 提取 fix commits
|
||||
FIXES=$(git log $COMMIT_RANGE --pretty=format:"%s" --grep="^fix" 2>/dev/null | sed 's/^fix[:(]//' | sed 's/^[^)]*): //' | sed 's/^/- 🐛 /')
|
||||
if [ -n "$FIXES" ]; then
|
||||
echo "### 修复"
|
||||
echo "$FIXES"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# 如果没有 feat 和 fix,显示提示
|
||||
if [ -z "$FEATS" ] && [ -z "$FIXES" ]; then
|
||||
echo "- 常规更新和优化"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "---"
|
||||
echo ""
|
||||
echo "## 下载说明"
|
||||
echo ""
|
||||
echo "| 平台 | 文件 |"
|
||||
echo "|------|------|"
|
||||
echo "| Mac 苹果芯片 | \`ChatLab-${VERSION_NUMBER}-arm64.dmg\` |"
|
||||
echo "| Mac Intel 芯片 | \`ChatLab-${VERSION_NUMBER}-x64.dmg\` |"
|
||||
echo "| Windows | \`ChatLab-${VERSION_NUMBER}-setup.exe\` |"
|
||||
} > release_notes.md
|
||||
|
||||
echo "Generated release notes:"
|
||||
cat release_notes.md
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.event_name == 'workflow_dispatch' && format('v{0}', inputs.version) || github.ref_name }}
|
||||
name: ChatLab ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref_name }}
|
||||
body_path: release_notes.md
|
||||
files: |
|
||||
dist/*.exe
|
||||
dist/*.dmg
|
||||
|
||||
@@ -135,7 +135,7 @@ export function trackDailyActive(): void {
|
||||
}
|
||||
|
||||
// 上报每日活跃事件
|
||||
trackEvent('app_daily_active', { is_new: isNew ? 1 : 0 })
|
||||
trackEvent(isNew ? 'app_daily_active_new' : 'app_daily_active')
|
||||
|
||||
data.lastReportDate = today
|
||||
saveAnalyticsData(data)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ChatLab",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"description": "获取你的聊天记录年度分析报告",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -77,7 +77,7 @@ async function handleFileDrop({ paths }: { files: File[]; paths: string[] }) {
|
||||
}
|
||||
|
||||
function openTutorial() {
|
||||
window.open('https://chatlab.fun/usage/how-to-export.html', '_blank')
|
||||
window.open('https://chatlab.fun/usage/how-to-export.html?utm_source=app', '_blank')
|
||||
}
|
||||
|
||||
function getProgressText(): string {
|
||||
|
||||
Reference in new issue
Block a user