Repository navigation
83 lines (69 loc) · 2.47 KB
/
Copy pathrelease.yml
File metadata and controls
83 lines (69 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build and Release
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- '.github/readme/**'
workflow_dispatch: # 允许手动触发
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Compile TypeScript
run: npm run compile
- name: Package extension
run: npx vsce package --allow-missing-repository
- name: Get package version
id: package_version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Check if tag exists
id: check_tag
run: |
if git ls-remote --tags origin | grep -q "refs/tags/v${{ steps.package_version.outputs.version }}"; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Upload VSIX as artifact
uses: actions/upload-artifact@v4
with:
name: ai-commit-${{ steps.package_version.outputs.version }}
path: "*.vsix"
retention-days: 90
- name: Skip release (version exists)
if: steps.check_tag.outputs.exists == 'true'
run: echo "::notice::Version v${{ steps.package_version.outputs.version }} already released. Update version in package.json to create a new release."
- name: Create Release
if: steps.check_tag.outputs.exists == 'false'
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.package_version.outputs.version }}
name: AI Commit v${{ steps.package_version.outputs.version }}
body: |
## AI Commit v${{ steps.package_version.outputs.version }}
### 安装方式
1. 下载 `.vsix` 文件
2. 在 VS Code 中按 `Ctrl+Shift+P` (Mac: `Cmd+Shift+P`)
3. 输入 `Extensions: Install from VSIX`
4. 选择下载的 `.vsix` 文件
### 功能
- AI 驱动的 Git commit 消息生成
- 支持 DeepSeek、智谱 AI、OpenAI 兼容 API
- Conventional Commits 格式
- Gitmoji 支持
files: "*.vsix"
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}