Skip to content

Commit 07f3e37

Browse files
committed
feat: add GitHub Actions release workflow and configuration UI
1 parent 5e8d5da commit 07f3e37

19 files changed

Lines changed: 1781 additions & 246 deletions

.github/workflows/release.yml

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

README.md

Lines changed: 43 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -1,175 +1,63 @@
1-
<p align="center">
2-
<img src=".github/assets/gitmoji.gif" width="400">
3-
</p>
1+
# AI Commit
42

5-
<p align="center">
6-
<img src="https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square">
7-
<a href="https://github.com/seatonjiang/gitmoji-vscode/issues">
8-
<img src="https://img.shields.io/github/issues/seatonjiang/gitmoji-vscode?style=flat-square&color=blue">
9-
</a>
10-
<a href="https://github.com/seatonjiang/gitmoji-vscode/pulls">
11-
<img src="https://img.shields.io/github/issues-pr/seatonjiang/gitmoji-vscode?style=flat-square&color=brightgreen">
12-
</a>
13-
<a href="https://github.com/seatonjiang/gitmoji-vscode/blob/main/LICENSE">
14-
<img src="https://img.shields.io/github/license/seatonjiang/gitmoji-vscode?&style=flat-square">
15-
</a>
16-
</p>
3+
AI-powered Git commit message generator for VS Code with Gitmoji support.
174

18-
<p align="center">在提交信息中添加表情符号的 VS Code 扩展</p>
5+
![alt text](image-1.png)
196

20-
<p align="center">
21-
<strong>简体中文</strong> · <a href=".github/readme/README.en.md">English</a> · <a href=".github/readme/README.pt-br.md">Português Brasileiro</a> ·
22-
<a href=".github/readme/README.pt-pt.md">Português Europeu</a> · <a href=".github/readme/README.ja.md">日本語</a> · <a href=".github/readme/README.ko.md">한국어</a>
23-
</p>
7+
![alt text](image.png)
248

25-
## 💻 扩展截图
9+
## Features
2610

27-
<p align="center">
28-
<img src=".github/assets/about.gif">
29-
</p>
11+
- **AI-Powered Commit Messages**: Generate commit messages using AI based on your staged changes
12+
- **Multiple AI Providers**: Support for DeepSeek, Zhipu AI (GLM), and OpenAI-compatible APIs
13+
- **Conventional Commits**: Generate messages following the Conventional Commits specification
14+
- **Style Learning**: Analyze your commit history to match your project's commit style
15+
- **Multi-language Support**: Generate commit messages in English or Chinese
16+
- **Gitmoji Integration**: Built-in Gitmoji support for adding emojis to your commits
3017

31-
## 📦 安装扩展
18+
## Supported AI Providers
3219

33-
1. 首先打开 [Visual Studio Code](https://code.visualstudio.com/)
34-
2. 使用 `Ctrl+Shift+X` 组合键打开「扩展」标签;
35-
3. 输入 `Gitmoji` 寻找此扩展;
36-
4. 点击 `安装` 按钮,然后点击 `启用` 按钮即可。
20+
| Provider | Description |
21+
|----------|-------------|
22+
| DeepSeek | Fast and affordable |
23+
| Zhipu AI (GLM) | Chinese language optimized |
24+
| OpenAI Compatible | Connect to any OpenAI-compatible API |
3725

38-
**提示**:也可以直接在 Marketplace 中找到 [Gitmoji](https://marketplace.visualstudio.com/items?itemName=seatonjiang.gitmoji-vscode),然后点击 `Install` 即可。
26+
## Usage
3927

40-
## 🔨 配置扩展
28+
1. Stage your changes with `git add`
29+
2. Click the sparkle icon in the SCM panel
30+
3. Wait for AI to generate the commit message
31+
4. Review and commit!
4132

42-
### 表情符号输出类型
33+
## Configuration
4334

44-
- `outputType` - 配置表情符号的输出类型(默认为 `emoji` 模式)。
35+
Open VS Code Settings and search for "AI Commit" to configure:
4536

46-
emoji 模式的例子:
37+
### AI Provider Settings
4738

48-
![emoji](.github/assets/emoji.png)
39+
- `aiCommit.provider`: Select AI provider (deepseek/zhipu/openai)
40+
- `aiCommit.deepseek.apiKey`: DeepSeek API Key
41+
- `aiCommit.zhipu.apiKey`: Zhipu AI API Key (format: api_key.secret)
42+
- `aiCommit.openai.apiKey`: OpenAI Compatible API Key
43+
- `aiCommit.openai.endpoint`: Custom API endpoint for OpenAI-compatible services
4944

50-
code 模式的例子:
45+
### General Settings
5146

52-
![code](.github/assets/code.png)
47+
- `aiCommit.language`: Commit message language (auto/en/zh)
48+
- `aiCommit.includeEmoji`: Include emoji in commit messages
49+
- `aiCommit.historyCount`: Number of historical commits to analyze for style learning
50+
- `aiCommit.maxDiffLength`: Maximum diff length to send to AI
5351

54-
示例配置:
52+
## Gitmoji Features
5553

56-
```json
57-
{
58-
"gitmoji.outputType": "emoji"
59-
}
60-
```
54+
This extension also includes Gitmoji functionality:
6155

62-
> **提示**:如果在 Gitlab 中使用,需要选择「code」模式;如果在 GitHub 中使用,可以随意选择「emoji」或「code」模式。
56+
- Click the smiley icon in SCM panel to choose a Gitmoji
57+
- Configure emoji output type (emoji or code)
58+
- Add custom emojis
59+
- Auto-match emojis based on commit message
6360

64-
### 添加自定义表情符号
61+
## License
6562

66-
- `addCustomEmoji` - 添加自定义表情符号。
67-
68-
示例配置:
69-
70-
```json
71-
{
72-
"gitmoji.addCustomEmoji": [
73-
{
74-
"emoji": "🧵",
75-
"code": ":thread:",
76-
"description": "添加或更新与多线程或并发相关的代码"
77-
},
78-
{
79-
"emoji": "🦺",
80-
"code": ":safety_vest:",
81-
"description": "添加或更新与验证相关的代码"
82-
}
83-
]
84-
}
85-
```
86-
87-
### 仅使用自定义表情符号
88-
89-
- `onlyUseCustomEmoji` - 仅使用自定义添加的表情符号,而不使用扩展中自带的表情符号(该功能默认关闭)。
90-
91-
示例配置:
92-
93-
```json
94-
{
95-
"gitmoji.onlyUseCustomEmoji": true
96-
}
97-
```
98-
99-
### 通过简码搜索表情符号
100-
101-
- `showEmojiCode` - 开启通过简码搜索表情符号功能(该功能默认关闭)。
102-
103-
示例配置:
104-
105-
```json
106-
{
107-
"gitmoji.showEmojiCode": true
108-
}
109-
```
110-
111-
### 插入位置
112-
113-
- `insertPosition` - 配置表情符号的插入位置(默认为 `start`)。
114-
- 可选值:
115-
- `start`:在消息开头插入,并清理既有前缀表情;
116-
- `end`:在消息末尾插入,并清理既有后缀表情;
117-
- `cursor`:在提交消息输入框的当前光标处插入。
118-
119-
示例配置(光标插入):
120-
121-
```json
122-
{
123-
"gitmoji.insertPosition": "cursor"
124-
}
125-
```
126-
127-
示例配置(消息末尾插入):
128-
129-
```json
130-
{
131-
"gitmoji.insertPosition": "end"
132-
}
133-
```
134-
135-
### 根据提交消息自动匹配表情符号
136-
137-
- `autoMatch` - 根据提交消息自动匹配表情符号功能(该功能默认关闭)。
138-
139-
示例配置:
140-
141-
```json
142-
{
143-
"gitmoji.autoMatch": true
144-
}
145-
```
146-
147-
### 允许重复使用表情符号
148-
149-
- `canRepeat` - 允许重复使用表情符号功能(该功能默认关闭)。
150-
151-
示例配置:
152-
153-
```json
154-
{
155-
"gitmoji.canRepeat": true
156-
}
157-
```
158-
159-
## 💖 项目支持
160-
161-
如果这个项目为你带来了便利,请考虑为这个项目点个 Star 或者通过微信赞赏码支持我,每一份支持都是我持续优化和添加新功能的动力源泉!
162-
163-
<div align="center">
164-
<b>微信赞赏码</b>
165-
<br>
166-
<img src=".github/assets/wechat-reward.png" width="230">
167-
</div>
168-
169-
## 🤝 参与共建
170-
171-
我们欢迎所有的贡献,你可以将任何想法作为 [Pull Requests](https://github.com/seatonjiang/gitmoji-vscode/pulls)[Issues](https://github.com/seatonjiang/gitmoji-vscode/issues) 提交。
172-
173-
## 📃 开源许可
174-
175-
项目基于 MIT 许可证发布,详细说明请参阅 [LICENSE](https://github.com/seatonjiang/gitmoji-vscode/blob/main/LICENSE) 文件。
63+
MIT

image-1.png

26.7 KB
Loading

image.png

89.2 KB
Loading

0 commit comments

Comments
 (0)