ci: add GitHub Actions workflows with semantic-release auto-versioning
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
components: clippy
|
||||
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
|
||||
- name: Test
|
||||
run: cargo test
|
||||
|
||||
- name: Clippy
|
||||
run: cargo clippy -- -D warnings
|
||||
@@ -0,0 +1,57 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
|
||||
- name: Test
|
||||
run: cargo test
|
||||
|
||||
release:
|
||||
name: Semantic Release
|
||||
needs: [test]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
|
||||
- name: Install semantic-release
|
||||
run: |
|
||||
npm install -D \
|
||||
semantic-release \
|
||||
@semantic-release/exec \
|
||||
@semantic-release/git \
|
||||
@semantic-release/changelog \
|
||||
@semantic-release/github
|
||||
|
||||
- name: Run semantic-release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: npx semantic-release
|
||||
+4
-1
@@ -1,3 +1,6 @@
|
||||
target/
|
||||
.env
|
||||
.claude/settings.local.json
|
||||
.claude/settings.local.json
|
||||
node_modules/
|
||||
package.json
|
||||
package-lock.json
|
||||
@@ -0,0 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
@@ -89,6 +89,49 @@ Controller (key input → Action) → Event Loop → LLM stream → Tool executi
|
||||
- **Auto inline review** after each edit: `src/app/subagent/auto.rs` — `spawn_quick_review()` injects verdict back into LLM conversation.
|
||||
- **Background subagents** (test-gen, arch-review, security-review) fire asynchronously at turn end via `TurnEvent::SystemNote`.
|
||||
|
||||
## Commit Convention
|
||||
|
||||
Gunakan **Conventional Commits** untuk semua commit. Format:
|
||||
|
||||
```
|
||||
<type>(<scope>): <description>
|
||||
```
|
||||
|
||||
**Type & efek ke versi:**
|
||||
|
||||
| Type | Bump | Kapan pakai |
|
||||
|-------------|-------|------------------------------------------|
|
||||
| `feat` | minor | Fitur baru |
|
||||
| `fix` | patch | Perbaikan bug |
|
||||
| `chore` | patch | Maintenance, update deps, dll |
|
||||
| `docs` | patch | Perubahan dokumentasi/comment |
|
||||
| `refactor` | patch | Refactor kode tanpa perubahan fungsional |
|
||||
| `test` | patch | Nambah/ubah test |
|
||||
| `style` | patch | Formatting, whitespace, lint |
|
||||
| `perf` | patch | Optimasi performa |
|
||||
| `ci` | patch | Perubahan CI/CD |
|
||||
|
||||
**Catatan:**
|
||||
- **Semua type menghasilkan release** (patch minimal). Tidak ada commit yang "skip release".
|
||||
- Tambahkan `BREAKING CHANGE:` di body commit untuk bump **major**.
|
||||
- **Scope** opsional, tapi direkomendasikan (misal `feat(agent):`, `fix(ipc):`).
|
||||
|
||||
### Contoh
|
||||
|
||||
```
|
||||
feat(tool): add batch file delete
|
||||
|
||||
chore: bump reqwest to 0.12
|
||||
|
||||
refactor(harness): flatten guard pipeline
|
||||
|
||||
fix(ipc): reconnect loop on socket timeout
|
||||
|
||||
docs: add architecture diagram to README
|
||||
|
||||
BREAKING CHANGE: IPC frame header changed from 4-byte to 8-byte length
|
||||
```
|
||||
|
||||
## Code Documentation
|
||||
|
||||
Every function, struct, enum, trait, module, and significant code block must have a doc comment (`///` or `//!`) that explains:
|
||||
|
||||
@@ -316,6 +316,62 @@ cargo build --release
|
||||
```
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Development
|
||||
|
||||
### Commit Convention
|
||||
|
||||
Project ini menggunakan **Conventional Commits** untuk otomatis menentukan versi rilis (melalui semantic-release).
|
||||
|
||||
Format:
|
||||
```
|
||||
<type>(<scope>): <description>
|
||||
|
||||
[optional body]
|
||||
|
||||
[optional footer]
|
||||
```
|
||||
|
||||
**`<type>` — menentukan bump version:**
|
||||
|
||||
| Type | Bump | Keterangan |
|
||||
|-------------|---------|-------------------------------------------|
|
||||
| `feat` | minor | Fitur baru |
|
||||
| `fix` | patch | Perbaikan bug |
|
||||
| `chore` | patch | Tugas maintenance, refactor ringan |
|
||||
| `docs` | patch | Perubahan dokumentasi |
|
||||
| `refactor` | patch | Refactor kode (tanpa perubahan fungsional)|
|
||||
| `test` | patch | Penambahan atau perbaikan test |
|
||||
| `style` | patch | Perubahan formatting, whitespace, dll |
|
||||
| `perf` | patch | Optimasi performa |
|
||||
| `ci` | patch | Perubahan CI/CD |
|
||||
|
||||
**`BREAKING CHANGE`** pada body commit → **major** (apa pun typenya).
|
||||
|
||||
Contoh:
|
||||
```
|
||||
feat(agent): add workspace-aware file search
|
||||
|
||||
Implement context-aware search scoped to current workspace directory.
|
||||
|
||||
BREAKING CHANGE: search results now filter by workspace scope.
|
||||
```
|
||||
|
||||
```
|
||||
fix(ipc): handle partial frame on unix socket reconnect
|
||||
```
|
||||
|
||||
```
|
||||
chore: update rustls to 0.23
|
||||
```
|
||||
|
||||
### Release Workflow
|
||||
|
||||
Push ke branch `main` akan memicu:
|
||||
1. **CI** — `cargo build --release` + `cargo test`
|
||||
2. **Semantic Release** — analisis commit → update `Cargo.toml` + `CHANGELOG.md` → git tag → GitHub Release dengan binary
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
module.exports = {
|
||||
branches: ["main"],
|
||||
plugins: [
|
||||
[
|
||||
"@semantic-release/commit-analyzer",
|
||||
{
|
||||
preset: "angular",
|
||||
releaseRules: [
|
||||
{ type: "chore", release: "patch" },
|
||||
{ type: "docs", release: "patch" },
|
||||
{ type: "refactor", release: "patch" },
|
||||
{ type: "test", release: "patch" },
|
||||
{ type: "style", release: "patch" },
|
||||
{ type: "perf", release: "patch" },
|
||||
{ type: "ci", release: "patch" },
|
||||
],
|
||||
},
|
||||
],
|
||||
"@semantic-release/release-notes-generator",
|
||||
"@semantic-release/changelog",
|
||||
[
|
||||
"@semantic-release/exec",
|
||||
{
|
||||
prepareCmd:
|
||||
'sed -i \'s/^version = ".*"/version = "${nextRelease.version}"/\' Cargo.toml && cargo check',
|
||||
publishCmd: "cargo build --release",
|
||||
},
|
||||
],
|
||||
[
|
||||
"@semantic-release/git",
|
||||
{
|
||||
assets: ["Cargo.toml", "Cargo.lock", "CHANGELOG.md"],
|
||||
message:
|
||||
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
|
||||
},
|
||||
],
|
||||
[
|
||||
"@semantic-release/github",
|
||||
{
|
||||
assets: [
|
||||
{
|
||||
path: "target/release/zesdex",
|
||||
label: "zesdex-${nextRelease.version}-linux-amd64",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user