chore: configure releases and develop workflow
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"main": "2567a755569e6ef6ba12063b62f202fe52884ce7",
|
||||
"frontend": "0244acf429c525b23117f165bbe52ef5403eefd3",
|
||||
"backend": "660b250ecd05e38784690b9a9adb381764c0ca7c",
|
||||
"specs": "9e227a563dda67620f0ad78228aa8a4c18bf35a0"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
name: Conventional commits
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, edited]
|
||||
|
||||
jobs:
|
||||
commits:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
- uses: https://github.com/actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- run: npm ci --ignore-scripts
|
||||
- name: Check PR title and commits
|
||||
env:
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
run: |
|
||||
printf '%s\n' "$PR_TITLE" | npm run commitlint -- --strict
|
||||
npm run commitlint -- --strict --from "$BASE_SHA" --to "$HEAD_SHA"
|
||||
+23
-18
@@ -2,8 +2,8 @@ name: Docs verify
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
branches: ['**']
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
verify:
|
||||
@@ -12,27 +12,32 @@ jobs:
|
||||
run:
|
||||
working-directory: workspace/docs
|
||||
steps:
|
||||
- name: Checkout workspace root
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
repository: WealthLedger/main
|
||||
ref: main
|
||||
path: workspace
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
path: workspace/docs
|
||||
- name: Checkout linked repositories
|
||||
run: |
|
||||
git clone --depth 1 --branch main https://git.personal.ksv741.ru/WealthLedger/frontend.git ../frontend
|
||||
git clone --depth 1 --branch main https://git.personal.ksv741.ru/WealthLedger/backend.git ../backend
|
||||
git clone --depth 1 --branch main https://git.personal.ksv741.ru/WealthLedger/specs.git ../specs
|
||||
- name: Record checked revisions
|
||||
- name: Checkout compatible peer revisions
|
||||
env:
|
||||
SOURCE_BRANCH: ${{ github.head_ref || github.ref_name }}
|
||||
TARGET_BRANCH: ${{ github.base_ref || github.ref_name }}
|
||||
run: |
|
||||
set -eu
|
||||
for repo in main frontend backend specs; do
|
||||
ref=develop
|
||||
case "$SOURCE_BRANCH:$TARGET_BRANCH" in
|
||||
release/*:*|*:main)
|
||||
ref=$(jq -er --arg repo "$repo" '.[$repo]' .ci/refs.json)
|
||||
printf '%s\n' "$ref" | grep -Eq '^[0-9a-f]{40}$'
|
||||
;;
|
||||
esac
|
||||
target="../$repo"
|
||||
if [ "$repo" = main ]; then target=..; fi
|
||||
git init "$target"
|
||||
git -C "$target" remote add origin "https://git.personal.ksv741.ru/WealthLedger/$repo.git"
|
||||
git -C "$target" fetch --depth 1 origin "$ref"
|
||||
git -C "$target" checkout --detach FETCH_HEAD
|
||||
git -C "$target" rev-parse HEAD
|
||||
done
|
||||
git rev-parse HEAD
|
||||
git -C .. rev-parse HEAD
|
||||
git -C ../frontend rev-parse HEAD
|
||||
git -C ../backend rev-parse HEAD
|
||||
git -C ../specs rev-parse HEAD
|
||||
- uses: https://github.com/actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: workspace/docs/.nvmrc
|
||||
|
||||
@@ -2,5 +2,20 @@
|
||||
"config": {
|
||||
"MD013": false
|
||||
},
|
||||
"customRules": ["markdownlint-rule-relative-links"]
|
||||
"customRules": [
|
||||
"markdownlint-rule-relative-links"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"filter": [
|
||||
"CHANGELOG.md"
|
||||
],
|
||||
"config": {
|
||||
"MD024": {
|
||||
"siblings_only": true
|
||||
}
|
||||
},
|
||||
"combine": "merge"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
{
|
||||
"git": {
|
||||
"requireBranch": "release/*",
|
||||
"requireCleanWorkingDir": true,
|
||||
"requireUpstream": false,
|
||||
"requireCommits": true,
|
||||
"commitMessage": "chore(release): ${version}",
|
||||
"tagName": "v${version}",
|
||||
"tag": false,
|
||||
"push": false
|
||||
},
|
||||
"npm": {
|
||||
"publish": false
|
||||
},
|
||||
"github": {
|
||||
"release": false
|
||||
},
|
||||
"gitlab": {
|
||||
"release": false
|
||||
},
|
||||
"hooks": {
|
||||
"after:git:init": "node scripts/check-release.cjs"
|
||||
},
|
||||
"plugins": {
|
||||
"@release-it/conventional-changelog": {
|
||||
"infile": "CHANGELOG.md",
|
||||
"preset": {
|
||||
"name": "conventionalcommits",
|
||||
"types": [
|
||||
{
|
||||
"type": "chore",
|
||||
"scope": "release",
|
||||
"effect": "hidden"
|
||||
},
|
||||
{
|
||||
"type": "feat",
|
||||
"section": "Features",
|
||||
"effect": "bump"
|
||||
},
|
||||
{
|
||||
"type": "fix",
|
||||
"section": "Bug Fixes",
|
||||
"effect": "bump"
|
||||
},
|
||||
{
|
||||
"type": "perf",
|
||||
"section": "Performance",
|
||||
"effect": "bump"
|
||||
},
|
||||
{
|
||||
"type": "docs",
|
||||
"section": "Documentation",
|
||||
"effect": "bump"
|
||||
},
|
||||
{
|
||||
"type": "spec",
|
||||
"section": "Specifications",
|
||||
"effect": "bump"
|
||||
},
|
||||
{
|
||||
"type": "refactor",
|
||||
"section": "Refactoring",
|
||||
"effect": "bump"
|
||||
},
|
||||
{
|
||||
"type": "build",
|
||||
"section": "Build",
|
||||
"effect": "bump"
|
||||
},
|
||||
{
|
||||
"type": "ci",
|
||||
"section": "CI",
|
||||
"effect": "bump"
|
||||
},
|
||||
{
|
||||
"type": "test",
|
||||
"section": "Tests",
|
||||
"effect": "bump"
|
||||
},
|
||||
{
|
||||
"type": "style",
|
||||
"section": "Styles",
|
||||
"effect": "bump"
|
||||
},
|
||||
{
|
||||
"type": "chore",
|
||||
"section": "Maintenance",
|
||||
"effect": "bump"
|
||||
},
|
||||
{
|
||||
"type": "revert",
|
||||
"section": "Reverts",
|
||||
"effect": "bump"
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"host": "https://git.personal.ksv741.ru",
|
||||
"owner": "WealthLedger",
|
||||
"repository": "docs",
|
||||
"linkReferences": true,
|
||||
"commit": "commit"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,3 +15,10 @@
|
||||
[доступные проверки](CONTRIBUTING.md#проверки), включая новые файлы.
|
||||
Сохрани границы задачи и чужие изменения. Успех Markdown-проверки не заменяет
|
||||
смысловую сверку и не доказывает рендер диаграмм.
|
||||
|
||||
## Ветки и релизы
|
||||
|
||||
Работа — в отдельной ветке от `develop`, затем PR в `develop`; в `main` напрямую
|
||||
не пушить. Release/hotfix и синхронизация веток — по [root README](../README.md#релизы-и-ветки).
|
||||
Commits и заголовки PR — Conventional Commits; для спецификаций допустим `spec:`.
|
||||
Перед подготовкой релиза прочитай root README; версии вручную не повышать.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# Changelog
|
||||
+8
-3
@@ -16,7 +16,8 @@ Docs даёт самостоятельное понимание продукта
|
||||
| Размещение кода, conventions, команды разработки и проверки | Локальные инструкции frontend/backend |
|
||||
| Выбор репозитория и типа знания | Корневой [AGENTS](../AGENTS.md) |
|
||||
|
||||
История поставок, аудитов и проверок остаётся в Git, Issues и PR.
|
||||
История аудитов и проверок остаётся в Git, Issues и PR. `CHANGELOG.md`
|
||||
генерируется release-it из commits; вручную дублировать его на тематических страницах не нужно.
|
||||
Процесс разработки и инструкции агентов принадлежат локальным инструкциям
|
||||
репозиториев. ADR фиксируют решения самой системы, а не организацию работы.
|
||||
|
||||
@@ -167,10 +168,12 @@ npm run verify
|
||||
|
||||
### CI и обновления зависимостей
|
||||
|
||||
`.gitea/workflows/verify.yml` запускает этот gate на каждом push ветки с Node
|
||||
`.gitea/workflows/verify.yml` запускает этот gate на push и PR с Node
|
||||
из `.nvmrc` и установкой через `npm ci`. Checkout docs размещается внутри
|
||||
workspace из `WealthLedger/main`, рядом с frontend, backend и specs. Соседние
|
||||
репозитории берутся из `main`; SHA всех пяти участников сохраняются в логе.
|
||||
репозитории для разработки берутся из `develop`; для `main`, PR в `main`
|
||||
и `release/*` — из полных SHA в `.ci/refs.json`. SHA всех пяти участников
|
||||
сохраняются в логе.
|
||||
Ошибка checkout, Markdown или относительной ссылки завершает job с FAIL.
|
||||
Это проверка ссылок на выбранные revisions, без Mermaid-render и semantic review.
|
||||
|
||||
@@ -183,3 +186,5 @@ DoS в TOML parser markdownlint-cli2; его можно удалить, когд
|
||||
Renovate объединяет minor/patch updates; major требует согласования в
|
||||
Dependency Dashboard, automerge не включён. Required checks включаются
|
||||
отдельно в Gitea; workflow сам по себе не запрещает merge.
|
||||
|
||||
Версии и ветки: [процесс релиза](../README.md#релизы-и-ветки).
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
extends: ["@commitlint/config-conventional"],
|
||||
rules: { "type-enum": [2, "always", ["feat", "fix", "perf", "docs", "spec", "refactor", "build", "ci", "test", "style", "chore", "revert"]] },
|
||||
};
|
||||
Generated
+3529
-3
File diff suppressed because it is too large
Load Diff
+11
-3
@@ -1,17 +1,25 @@
|
||||
{
|
||||
"name": "wealth-ledger-docs",
|
||||
"version": "1.0.0",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": "24.21.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "markdownlint-cli2 \"**/*.md\" \"#node_modules\"",
|
||||
"verify": "npm run lint && git diff --check"
|
||||
"verify": "npm run lint && git diff --check",
|
||||
"release:preview": "release-it --dry-run --ci",
|
||||
"release:prepare": "release-it --ci",
|
||||
"commitlint": "commitlint"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "21.2.2",
|
||||
"@commitlint/config-conventional": "21.2.2",
|
||||
"@release-it/conventional-changelog": "12.0.0",
|
||||
"conventional-changelog-conventionalcommits": "10.4.0",
|
||||
"markdownlint-cli2": "0.23.2",
|
||||
"markdownlint-rule-relative-links": "5.1.2"
|
||||
"markdownlint-rule-relative-links": "5.1.2",
|
||||
"release-it": "21.0.2"
|
||||
},
|
||||
"overrides": {
|
||||
"markdownlint-cli2@0.23.2": {
|
||||
|
||||
+4
-1
@@ -9,7 +9,7 @@
|
||||
"dependencies"
|
||||
],
|
||||
"dependencyDashboard": true,
|
||||
"rangeStrategy": "bump",
|
||||
"rangeStrategy": "pin",
|
||||
"packageRules": [
|
||||
{
|
||||
"matchUpdateTypes": [
|
||||
@@ -24,5 +24,8 @@
|
||||
],
|
||||
"dependencyDashboardApproval": true
|
||||
}
|
||||
],
|
||||
"baseBranchPatterns": [
|
||||
"develop"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
const assert = require("node:assert/strict");
|
||||
const { execFileSync } = require("node:child_process");
|
||||
const { version } = require("../package.json");
|
||||
const git = (...args) => execFileSync("git", args, { encoding: "utf8" }).trim();
|
||||
|
||||
assert.equal(git("status", "--porcelain"), "", "Commit all changes before preparing a release");
|
||||
const tags = git("tag", "--merged", "HEAD", "--list", "v[0-9]*", "--sort=-version:refname")
|
||||
.split("\n").filter(tag => /^v\d+\.\d+\.\d+$/.test(tag));
|
||||
assert.equal(version, tags[0]?.slice(1) ?? "0.0.0",
|
||||
"Version is already prepared or release tags are missing. Fetch tags; finish the existing release before preparing another.");
|
||||
Reference in New Issue
Block a user