CI / changes (push) Successful in 7s
CI / commitlint (push) Has been skipped
CI / openapi (push) Has been skipped
CI / web (push) Has been skipped
CI / go (push) Has been skipped
CI / bird2 (push) Has been skipped
CI / release (push) Successful in 17s
- Enhanced AGENTS.md to clarify the use of `/commit-message` and the exclusion of the Source Control button for generating commit messages. - Updated conventional-commits.mdc to include new triggers and guidelines for commit message types, emphasizing the importance of semver impact. - Revised commit-message SKILL.md to specify the mandatory execution of scripts and the correct usage of types and scopes in commit messages. - Improved README documentation to reflect the updated guidelines and workflows for generating commit messages.
75 lines
4.0 KiB
Markdown
75 lines
4.0 KiB
Markdown
# Релизы и версионирование EvoBGP
|
||
|
||
EvoBGP использует [Conventional Commits](https://www.conventionalcommits.org/) и [semantic-release](https://semantic-release.gitbook.io/) для полностью автоматических релизов на Gitea (`git.shts.su`). Ручное повышение версии в коде не требуется.
|
||
|
||
## Как определяется версия
|
||
|
||
| Тип коммита | Bump |
|
||
|-------------|------|
|
||
| `feat` | minor (1.0.0 → 1.1.0) |
|
||
| `fix`, `perf` | patch (1.0.0 → 1.0.1) |
|
||
| `feat!`, `fix!` или `BREAKING CHANGE:` в теле | major (1.0.0 → 2.0.0) |
|
||
| `docs`, `chore`, `ci`, `test`, `refactor` | без релиза |
|
||
|
||
Первый релиз при отсутствии git-тегов — **1.0.0**, если есть releasable-коммиты.
|
||
|
||
**Как не перепутать `feat` и `fix`:** см. раздел «Выбор type: semver, а не «красивые слова»» в [.cursor/rules/conventional-commits.mdc](../.cursor/rules/conventional-commits.mdc). Кратко: `feat` — новая возможность (minor); `fix` — починка ожидаемого поведения (patch); follow-up баги после недавнего `feat` — всегда `fix`, даже если diff большой.
|
||
|
||
Подробные правила сообщений коммитов: [.cursor/rules/conventional-commits.mdc](../.cursor/rules/conventional-commits.mdc).
|
||
|
||
## CI-пайплайн (один push в main)
|
||
|
||
```text
|
||
push/merge в main
|
||
→ CI: openapi, web, go, bird2 (параллельно)
|
||
→ job release (в том же workflow, после quality gates):
|
||
→ semantic-release: git tag vX.Y.Z на текущий commit (без доп. commit)
|
||
→ Gitea Release + CHANGELOG.md как attachment
|
||
→ docker buildx bake с VERSION=X.Y.Z
|
||
→ образы: latest, vX.Y.Z, X.Y.Z, sha-*, короткий SHA
|
||
```
|
||
|
||
Pull request: только quality gates + commitlint; релиз и образы **не** публикуются.
|
||
|
||
Workflow: [.gitea/workflows/ci.yaml](../.gitea/workflows/ci.yaml) (job **release**).
|
||
|
||
Конфиг semantic-release: [.releaserc.json](../.releaserc.json) — без `@semantic-release/git` (CHANGELOG не коммитится в репозиторий).
|
||
|
||
## Секреты Gitea
|
||
|
||
Один PAT — **`ACTIONS_PAT`** (Settings → Actions → Secrets).
|
||
|
||
| Право PAT | Зачем |
|
||
|-----------|--------|
|
||
| push tags | git tag `vX.Y.Z` на commit merge |
|
||
| releases | Gitea Release + notes |
|
||
| packages (Container Registry) | push образов |
|
||
|
||
Fallback: **`gitea.token`** (нужны права на releases и packages).
|
||
|
||
## Источник правды для версии в runtime
|
||
|
||
Semver из git-тега пробрасывается в Go-бинарники через `-ldflags` при сборке Docker (`deploy/docker/gobinary/Dockerfile`). Пакет [`internal/version`](../internal/version/version.go):
|
||
|
||
- локально (`go run`) — `version: "dev"`
|
||
- в образе после релиза — совпадает с тегом (например `1.2.3`)
|
||
|
||
API: `GET /version`, `GET /v1/version` — поля `version`, `git_sha`, `build_time`.
|
||
|
||
Web UI показывает версию из API (footer sidebar, страница «Мониторинг»).
|
||
|
||
## CHANGELOG
|
||
|
||
Release notes — в Gitea Release; файл `CHANGELOG.md` генерируется в CI и прикрепляется как asset, **не** попадает в git history.
|
||
|
||
## Проверка после релиза
|
||
|
||
1. Один run workflow **CI** на push в main: job **release** зелёный.
|
||
2. Gitea: тег `vX.Y.Z` на том же commit, что и merge; Release с notes.
|
||
3. Container Registry: `evobgp-api:vX.Y.Z`, `evobgp-api:X.Y.Z`, `evobgp-api:latest`.
|
||
4. `curl http://localhost:8080/version` → `"version":"X.Y.Z"`.
|
||
|
||
## Первый релиз (bootstrap)
|
||
|
||
Merge в `main` с `feat(release): ...` → **v1.0.0** в том же CI run.
|