chore: configure releases and develop workflow
This commit is contained in:
@@ -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"
|
||||||
@@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- '**'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
verify:
|
verify:
|
||||||
|
|||||||
@@ -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": "frontend",
|
||||||
|
"linkReferences": true,
|
||||||
|
"commit": "commit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,3 +27,10 @@ Code/style checks автоматические только в scope конфи
|
|||||||
semantic placement и выбор полезных тестов обязательны при review.
|
semantic placement и выбор полезных тестов обязательны при review.
|
||||||
Storybook уже доступен как reference; ожидаемый UI и его состояния определяет
|
Storybook уже доступен как reference; ожидаемый UI и его состояния определяет
|
||||||
задача, а визуальное соответствие проверяется отдельно от сборки.
|
задача, а визуальное соответствие проверяется отдельно от сборки.
|
||||||
|
|
||||||
|
## Ветки и релизы
|
||||||
|
|
||||||
|
Работа — в отдельной ветке от `develop`, затем PR в `develop`; в `main` напрямую
|
||||||
|
не пушить. Release/hotfix и синхронизация веток — по [root README](../README.md#релизы-и-ветки).
|
||||||
|
Commits и заголовки PR — Conventional Commits; для спецификаций допустим `spec:`.
|
||||||
|
Перед подготовкой релиза прочитай root README; версии вручную не повышать.
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
# Changelog
|
||||||
@@ -73,3 +73,8 @@ backend командой `npm run test:openapi-contract`.
|
|||||||
Разработка идёт напрямую по задаче пользователя. Каждый affected repo проходит
|
Разработка идёт напрямую по задаче пользователя. Каждый affected repo проходит
|
||||||
свой verify; при изменении wire contract дополнительно выполняется contract check.
|
свой verify; при изменении wire contract дополнительно выполняется contract check.
|
||||||
Обязательного OpenSpec/SDD lifecycle нет.
|
Обязательного OpenSpec/SDD lifecycle нет.
|
||||||
|
|
||||||
|
Версии и ветки: [процесс релиза](../README.md#релизы-и-ветки).
|
||||||
|
|
||||||
|
Knip исключает `conventional-changelog-conventionalcommits`: release-it загружает
|
||||||
|
preset по имени из `.release-it.json`. Версия preset закреплена напрямую.
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
extends: ["@commitlint/config-conventional"],
|
extends: ["@commitlint/config-conventional"],
|
||||||
|
rules: {
|
||||||
|
"type-enum": [
|
||||||
|
2,
|
||||||
|
"always",
|
||||||
|
[
|
||||||
|
"feat",
|
||||||
|
"fix",
|
||||||
|
"perf",
|
||||||
|
"docs",
|
||||||
|
"spec",
|
||||||
|
"refactor",
|
||||||
|
"build",
|
||||||
|
"ci",
|
||||||
|
"test",
|
||||||
|
"style",
|
||||||
|
"chore",
|
||||||
|
"revert",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"project": ["src/**/*.{ts,tsx}", "!src/shared/api/generated/**"]
|
"project": ["src/**/*.{ts,tsx}", "!src/shared/api/generated/**"],
|
||||||
|
"ignoreDependencies": ["conventional-changelog-conventionalcommits"]
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+2195
-16
File diff suppressed because it is too large
Load Diff
+7
-1
@@ -24,7 +24,10 @@
|
|||||||
"verify": "npm run openapi:check && npm run typecheck && npm run lint && npm run test:coverage && npm run knip && npm run deps && npm run deps:storybook && npm run build && npm run build:catalog",
|
"verify": "npm run openapi:check && npm run typecheck && npm run lint && npm run test:coverage && npm run knip && npm run deps && npm run deps:storybook && npm run build && npm run build:catalog",
|
||||||
"prepare": "husky",
|
"prepare": "husky",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"deps:storybook": "depcruise src .storybook/preview.tsx --config .storybook/dependency-cruiser.cjs --output-type err-long"
|
"deps:storybook": "depcruise src .storybook/preview.tsx --config .storybook/dependency-cruiser.cjs --output-type err-long",
|
||||||
|
"release:preview": "release-it --dry-run --ci",
|
||||||
|
"release:prepare": "release-it --ci",
|
||||||
|
"commitlint": "commitlint"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.{css,html,json,md,ts,tsx}": "biome format --write --no-errors-on-unmatched"
|
"*.{css,html,json,md,ts,tsx}": "biome format --write --no-errors-on-unmatched"
|
||||||
@@ -55,6 +58,7 @@
|
|||||||
"@biomejs/biome": "2.5.13",
|
"@biomejs/biome": "2.5.13",
|
||||||
"@commitlint/cli": "21.2.2",
|
"@commitlint/cli": "21.2.2",
|
||||||
"@commitlint/config-conventional": "21.2.2",
|
"@commitlint/config-conventional": "21.2.2",
|
||||||
|
"@release-it/conventional-changelog": "12.0.0",
|
||||||
"@rolldown/plugin-babel": "0.2.4",
|
"@rolldown/plugin-babel": "0.2.4",
|
||||||
"@storybook/addon-docs": "10.6.0",
|
"@storybook/addon-docs": "10.6.0",
|
||||||
"@storybook/react-vite": "10.6.0",
|
"@storybook/react-vite": "10.6.0",
|
||||||
@@ -66,6 +70,7 @@
|
|||||||
"@vitejs/plugin-react": "6.1.1",
|
"@vitejs/plugin-react": "6.1.1",
|
||||||
"@vitest/coverage-v8": "5.0.0",
|
"@vitest/coverage-v8": "5.0.0",
|
||||||
"babel-plugin-react-compiler": "1.0.0",
|
"babel-plugin-react-compiler": "1.0.0",
|
||||||
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
||||||
"dependency-cruiser": "18.2.0",
|
"dependency-cruiser": "18.2.0",
|
||||||
"husky": "9.1.7",
|
"husky": "9.1.7",
|
||||||
"jsdom": "30.0.1",
|
"jsdom": "30.0.1",
|
||||||
@@ -73,6 +78,7 @@
|
|||||||
"lint-staged": "17.5.1",
|
"lint-staged": "17.5.1",
|
||||||
"msw": "2.15.0",
|
"msw": "2.15.0",
|
||||||
"openapi-typescript": "7.13.0",
|
"openapi-typescript": "7.13.0",
|
||||||
|
"release-it": "21.0.2",
|
||||||
"storybook": "10.6.0",
|
"storybook": "10.6.0",
|
||||||
"typescript": "5.9.3",
|
"typescript": "5.9.3",
|
||||||
"vite": "8.3.0",
|
"vite": "8.3.0",
|
||||||
|
|||||||
+3
-2
@@ -4,7 +4,7 @@
|
|||||||
"timezone": "Europe/Moscow",
|
"timezone": "Europe/Moscow",
|
||||||
"labels": ["dependencies"],
|
"labels": ["dependencies"],
|
||||||
"dependencyDashboard": true,
|
"dependencyDashboard": true,
|
||||||
"rangeStrategy": "bump",
|
"rangeStrategy": "pin",
|
||||||
"packageRules": [
|
"packageRules": [
|
||||||
{
|
{
|
||||||
"matchUpdateTypes": ["minor", "patch"],
|
"matchUpdateTypes": ["minor", "patch"],
|
||||||
@@ -14,5 +14,6 @@
|
|||||||
"matchUpdateTypes": ["major"],
|
"matchUpdateTypes": ["major"],
|
||||||
"dependencyDashboardApproval": true
|
"dependencyDashboardApproval": true
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"baseBranchPatterns": ["develop"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
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