Skip to content

Commit 8d44e17

Browse files
pleberreclaude
andcommitted
feat(deployment): add semantic versioning and automated releases
Add comprehensive tooling for conventional commits and semantic releases: - Commitlint for commit message validation - Husky for git hooks (pre-commit, commit-msg) - Commitizen for interactive commit creation - Semantic-release for automated versioning - GitHub Actions workflow for CI/CD - Documentation updates (CLAUDE.md, README.md, CONTRIBUTING.md) This establishes automated release management for the deployment orchestration repository. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent bc8345c commit 8d44e17

File tree

11 files changed

+805
-0
lines changed

11 files changed

+805
-0
lines changed

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
9+
permissions:
10+
contents: write
11+
issues: write
12+
pull-requests: write
13+
14+
jobs:
15+
release:
16+
name: Semantic Release
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
persist-credentials: false
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
cache: 'npm'
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Verify commit format
36+
run: |
37+
npm install -g @commitlint/cli @commitlint/config-conventional
38+
npx commitlint --from HEAD~1 --to HEAD --verbose
39+
40+
- name: Run semantic-release
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
run: npx semantic-release
44+
45+
- name: Release summary
46+
if: success()
47+
run: |
48+
echo "✅ Release workflow completed successfully"
49+
echo "Check GitHub Releases: https://github.com/${{ github.repository }}/releases"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Validate Commits
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- develop
8+
9+
jobs:
10+
validate:
11+
name: Validate Commit Messages
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
25+
- name: Install commitlint
26+
run: |
27+
npm install -g @commitlint/cli @commitlint/config-conventional
28+
29+
- name: Validate commit messages
30+
run: |
31+
npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
32+
33+
- name: Validation success
34+
if: success()
35+
run: echo "✅ All commit messages follow conventional commit format"

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@ Thumbs.db
1919
# Logs
2020
*.log
2121
logs/
22+
23+
# Node.js dependencies
24+
node_modules/
25+
package-lock.json
26+
yarn.lock
27+
pnpm-lock.yaml

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit $1

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
echo "Running pre-commit checks..."

.releaserc.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"branches": [
3+
"master",
4+
{
5+
"name": "develop",
6+
"prerelease": "beta"
7+
}
8+
],
9+
"repositoryUrl": "https://github.com/Err0-io/err0server-deployment.git",
10+
"plugins": [
11+
[
12+
"@semantic-release/commit-analyzer",
13+
{
14+
"preset": "angular",
15+
"releaseRules": [
16+
{ "type": "feat", "release": "minor" },
17+
{ "type": "fix", "release": "patch" },
18+
{ "type": "perf", "release": "patch" },
19+
{ "type": "refactor", "release": "patch" },
20+
{ "type": "docs", "release": false },
21+
{ "type": "chore", "release": false },
22+
{ "type": "ci", "release": false },
23+
{ "breaking": true, "release": "major" }
24+
],
25+
"parserOpts": {
26+
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
27+
}
28+
}
29+
],
30+
[
31+
"@semantic-release/release-notes-generator",
32+
{
33+
"preset": "angular",
34+
"writerOpts": {
35+
"commitsSort": ["subject", "scope"]
36+
}
37+
}
38+
],
39+
[
40+
"@semantic-release/changelog",
41+
{
42+
"changelogFile": "CHANGELOG.md",
43+
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines."
44+
}
45+
],
46+
[
47+
"@semantic-release/npm",
48+
{
49+
"npmPublish": false
50+
}
51+
],
52+
[
53+
"@semantic-release/github",
54+
{
55+
"successComment": false,
56+
"failComment": false,
57+
"releasedLabels": false,
58+
"assets": [
59+
{
60+
"path": "docker-compose.yml",
61+
"label": "Docker Compose Configuration"
62+
},
63+
{
64+
"path": ".env.example",
65+
"label": "Environment Configuration Template"
66+
}
67+
]
68+
}
69+
],
70+
[
71+
"@semantic-release/git",
72+
{
73+
"assets": ["CHANGELOG.md", "package.json"],
74+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
75+
}
76+
]
77+
]
78+
}

CLAUDE.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,96 @@ This repository **must** be in a sibling directory relationship with the API and
3535
└── CLAUDE.md # This file
3636
```
3737

38+
## Commit Guidelines
39+
40+
This repository follows [Conventional Commits](https://www.conventionalcommits.org/) specification.
41+
42+
### Commit Message Format
43+
44+
```
45+
<type>(<scope>): <subject>
46+
47+
<body>
48+
49+
<footer>
50+
```
51+
52+
**Example:**
53+
```
54+
feat(compose): add health check timeout configuration
55+
56+
Add configurable health check timeouts for postgres service
57+
to allow customization in production environments.
58+
59+
BREAKING CHANGE: Health check configuration now requires
60+
explicit timeout values in .env file.
61+
```
62+
63+
### Commit Types
64+
65+
- **feat:** New service, configuration option, or deployment capability (triggers MINOR release)
66+
- **fix:** Bug fix in orchestration, environment config, or deployment (triggers PATCH release)
67+
- **docs:** Documentation only changes (no release)
68+
- **chore:** Maintenance tasks, dependency updates, tooling (no release)
69+
- **refactor:** Refactoring docker-compose configuration (triggers PATCH release)
70+
- **perf:** Performance improvements like resource limits, health checks (triggers PATCH release)
71+
- **ci:** Changes to CI/CD pipeline (no release)
72+
- **revert:** Revert a previous commit
73+
74+
### Breaking Changes
75+
76+
For incompatible changes requiring migration, add `BREAKING CHANGE:` in the footer:
77+
78+
```
79+
feat(postgres): upgrade to PostgreSQL 15
80+
81+
Upgrade database from PostgreSQL 14 to 15 for improved performance.
82+
83+
BREAKING CHANGE: Requires database migration. Run `docker-compose down -v`
84+
and restore from backup before upgrading.
85+
```
86+
87+
This triggers a MAJOR version bump (1.x.x → 2.0.0).
88+
89+
### Interactive Commits
90+
91+
Use Commitizen for guided commit messages:
92+
93+
```bash
94+
npm run commit
95+
```
96+
97+
## Versioning and Releases
98+
99+
This repository uses [Semantic Versioning](https://semver.org/):
100+
101+
- **MAJOR** (X.0.0): Breaking changes requiring migration
102+
- **MINOR** (1.X.0): New features, services, or configuration options
103+
- **PATCH** (1.0.X): Bug fixes, performance improvements, refactoring
104+
105+
### Release Process
106+
107+
Releases are **fully automated** via GitHub Actions:
108+
109+
1. Commit changes following conventional commit format
110+
2. Push to `master` branch (or merge PR)
111+
3. GitHub Actions analyzes commits
112+
4. Semantic-release determines next version
113+
5. CHANGELOG.md is generated
114+
6. Git tag is created
115+
7. GitHub Release is published with assets
116+
117+
**Manual release (local testing):**
118+
```bash
119+
npm run release:dry-run # Test without publishing
120+
npm run release # Publish release (requires GITHUB_TOKEN)
121+
```
122+
123+
### Version Branches
124+
125+
- **master:** Production releases (1.0.0, 1.1.0, 2.0.0)
126+
- **develop:** Beta pre-releases (1.0.0-beta.1, 1.0.0-beta.2)
127+
38128
## Essential Commands
39129

40130
### Start All Services

0 commit comments

Comments
 (0)