ci: semantic-release automation for tag/changelog (Option D)
Закрывает эту тему окончательно. После merge в main CI анализирует conventional commits с последнего tag'а, бампит package.json + CHANGELOG.md и пушит git tag vX.Y.Z. Tag pipeline далее собирает images и ждёт manual gate на trigger-deploy-prod. Что добавил: - ordinis-admin-ui/.releaserc.json — config (commit-analyzer, release-notes, changelog, npm[no-publish], git, gitlab). branches: ['main']. Маппинг conventional-commit types к bump levels. - ordinis-admin-ui/package.json — devDeps: semantic-release@24.2 + 6 plugins. - .gitlab-ci.yml — new 'release' stage + release job: - needs: trigger-deploy-staging (release ТОЛЬКО после зелёного staging) - image: node:22-alpine + pnpm@9.15.4 - GL_TOKEN из CI variable GITLAB_TOKEN (semantic-release/gitlab требует именно GL_TOKEN env name) - allow_failure: true (нет релизных commits = OK, не блокирует pipeline) - RELEASE.md — operator docs: - One-time setup: создать Project Access Token + GITLAB_TOKEN CI var - Commit conventions table (feat→minor, fix→patch, breaking→major) - Skip release (use chore: type или [skip ci]) - Dry-run command для local validation Prod safety: trigger-deploy-prod остаётся manual (when: manual). Автоматизация ТОЛЬКО tag-создания, не deploy. Tag → CI runs → human кликает Deploy. ACTION REQUIRED от user (one-time): 1. GitLab → Settings → Access Tokens → создать Project Access Token scopes: write_repository + api, role: Maintainer 2. GitLab → Settings → CI/CD → Variables → GITLAB_TOKEN (Masked, Protected) Без этого release job будет fail'ить (но pipeline не покраснеет — allow_failure).
This commit is contained in:
@@ -48,6 +48,12 @@
|
||||
"tw-animate-css": "^1.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/commit-analyzer": "^13.0.0",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/gitlab": "^13.2.4",
|
||||
"@semantic-release/npm": "^12.0.1",
|
||||
"@semantic-release/release-notes-generator": "^14.0.1",
|
||||
"@tailwindcss/vite": "^4.0.0-beta.7",
|
||||
"@tanstack/router-vite-plugin": "^1.86.0",
|
||||
"@testing-library/jest-dom": "^6.9.1",
|
||||
@@ -59,6 +65,7 @@
|
||||
"@types/react-dom": "^19.0.0",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"jsdom": "^29.1.1",
|
||||
"semantic-release": "^24.2.1",
|
||||
"tailwindcss": "^4.0.0-beta.7",
|
||||
"typescript": "^5.7.2",
|
||||
"vite": "^6.0.5",
|
||||
|
||||
Reference in New Issue
Block a user