Skip to content

Commit a5bb806

Browse files
committed
ci: implement automated release workflow with GoReleaser
1 parent 1295e24 commit a5bb806

2 files changed

Lines changed: 54 additions & 20 deletions

File tree

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v4
22+
with:
23+
go-version: 1.21
24+
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v4
27+
with:
28+
distribution: goreleaser
29+
version: latest
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ A lightweight CLI tool that analyzes your staged changes and generates professio
1616
- **Conventional Commits** - Follows the Conventional Commits specification for standardized messages
1717
- **Configuration Hierarchy** - Local (`.gitmit.json`) → Global (`~/.gitmit.json`) → Default (Embedded) config support
1818
- **Automatic Project Profiling** - Detects project type (Go, Node.js, Python, Java, etc.) from characteristic files
19-
- **Keyword Scoring Algorithm** - Analyzes git diff content and scores keywords to determine the best commit type
19+
- **Cross-Scoring Matrix** - Advanced weighted algorithm that aggregates signals from branch names, keywords, and diff stats
20+
- **Branch-Aware Intelligence** - Extracts intent and scope automatically from your git branch names
21+
- **Dependency Watcher** - Monitors `go.mod`, `package.json`, etc., to identify newly added libraries
2022
- **Symbol Extraction** - Uses language-aware regex to extract function, class, and variable names
2123
- **Git Porcelain Status** - Leverages `git status --porcelain` for accurate file state detection
22-
- **Diff Stat Analysis** - Infers intent based on added vs deleted lines ratio
23-
- **Commit History Context** - Maintains consistency by learning from recent commit messages
24+
- **Structural Ratio Analysis** - Computes Added/Deleted ratios to precisely distinguish between features and refactors
25+
- **Memory Optimized** - Streaming diff processing ensures high performance even with large changes
26+
- **Commit History Context** - Maintains consistency by learning from recent commit messages on your branch
2427
- **Interactive Mode** - Enhanced interactive prompts with y/n/e/r options (yes/no/edit/regenerate)
2528
- **Smart Regeneration** - Generate alternative commit messages with diverse suggestions
2629
- **Context-Aware Scoring** - Weighted algorithm for intelligent template selection
@@ -184,27 +187,26 @@ Gitmit uses intelligent offline algorithms to analyze your changes:
184187
- D (Deleted) → suggests `chore` or `refactor`
185188
- R (Renamed) → suggests `refactor`
186189

187-
3. **Keyword Scoring Algorithm** - Analyzes `git diff --cached` content:
188-
- Counts keyword occurrences
189-
- Multiplies by configured weights
190-
- Selects action with highest score
191-
- Example: `+ func` (weight: 3) + `+ class` (weight: 2) = 5 points for `feat`
190+
3. **Cross-Scoring Matrix** - Advanced signal aggregation:
191+
- **Branch Intent** (+3 pts): Extracted from patterns like `feature/auth` or `fix/bug-123`
192+
- **Keyword Scoring**: Analyzes `git diff` content with weighted keywords
193+
- **Diff Stat Ratio** (+2 pts): Analyzes structural ratio of Added/(Added+Deleted)
194+
- **Pattern Bonuses**: Extra weight for multi-file patterns (e.g., +4 for feature-addition)
192195

193196
4. **Symbol Extraction via Regex** - Language-aware pattern matching:
194197
- Go: Functions (`func Name(`), structs (`type Name struct`)
195-
- JavaScript: Functions, arrow functions, classes
198+
- JavaScript/TypeScript: Functions, arrow functions, classes
196199
- Python: Functions (`def name(`), classes (`class Name`)
197-
- Fills `{item}` placeholder automatically
200+
- Java: Classes and methods
198201

199-
5. **Path-based Topic Detection** - Uses `filepath.Dir` logic:
200-
- Custom topic mappings from config
201-
- Prioritizes `internal/` or `pkg/` subdirectories
202-
- Falls back to most specific directory name
202+
5. **Streaming Diff Processing** - Performance and memory efficiency:
203+
- Uses `StdoutPipe` to process git output line-by-line
204+
- Minimizes memory footprint for large changesets
205+
- Continuous signal processing during parsing
203206

204-
6. **Diff Stat Analysis** - Analyzes line change ratios:
205-
- Deleted lines > 70% → suggests `refactor` (cleanup)
206-
- Added lines > 70% with 50+ lines → suggests `feat` (new feature)
207-
- Balanced changes → suggests `refactor` (modification)
207+
6. **Dependency Watcher** - Monitors library additions:
208+
- Watches `go.mod`, `package.json`, `requirements.txt`, and `Cargo.toml`
209+
- Automatically assigns `chore(deps)` when new libraries are detected
208210

209211
7. **Commit History Context** - Maintains consistency:
210212
- Retrieves most recent commit message
@@ -437,5 +439,5 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
437439
- [ ] Integration with issue trackers
438440
- [ ] Multi-language support
439441
- [ ] Commit message templates
440-
- [ ] Branch-based suggestions
441-
- [ ] Commit message history learning
442+
- [x] Branch-based suggestions
443+
- [x] Commit message history learning

0 commit comments

Comments
 (0)