Skip to content

Commit 92af03a

Browse files
authored
Merge pull request #7 from sanderkooger/feat/automated-semversioning
Fix #3 - Implement automated semversioning
2 parents 0d56c72 + 0607ff1 commit 92af03a

File tree

14 files changed

+1849
-73
lines changed

14 files changed

+1849
-73
lines changed

.commitlintrc.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

.commitlintrc.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import type { UserConfig } from "@commitlint/types"; // [!code focus]
2+
import { RuleConfigSeverity } from "@commitlint/types"; // [!code focus]
3+
4+
const Configuration: UserConfig = {
5+
// [!code focus]
6+
extends: ["@commitlint/config-conventional"],
7+
parserPreset: "conventional-changelog-atom",
8+
formatter: "@commitlint/format",
9+
rules: {
10+
"type-enum": [
11+
RuleConfigSeverity.Error,
12+
"always",
13+
[
14+
"chore",
15+
"feat",
16+
"fix",
17+
"docs",
18+
"style",
19+
"refactor",
20+
"test",
21+
"revert",
22+
"build",
23+
"ci",
24+
],
25+
],
26+
},
27+
// ...
28+
};
29+
30+
export default Configuration;

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
on:
3+
push:
4+
branches-ignore:
5+
- main
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write # to be able to publish a GitHub release
11+
issues: write # to be able to comment on released issues
12+
pull-requests: write # to be able to comment on released pull requestsable to publish a GitHub release
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20.x
18+
- name: Install dependencies
19+
run: npm clean-install
20+
- name: build the package
21+
run: npm run build
22+
- name: run CI runners
23+
run: npm ci

.github/workflows/npm-publish.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [main]
5+
6+
jobs:
7+
#next only install build and release package
8+
release:
9+
name: Release
10+
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write # to be able to publish a GitHub release
14+
issues: write # to be able to comment on released issues
15+
pull-requests: write # to be able to comment on released pull requests
16+
id-token: write # to enable use of OIDC for npm provenance
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: "lts/*"
26+
- name: Install dependencies
27+
run: npm clean-install
28+
- name: build the package
29+
run: npm run build
30+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
31+
run: npm audit signatures
32+
- name: Release
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
run: npx semantic-release

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit "$1"

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run ci

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict = true

.releaserc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
"@semantic-release/npm",
8+
"@semantic-release/github",
9+
[
10+
"@semantic-release/git",
11+
{
12+
"assets": ["CHANGELOG.md", "package.json"],
13+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
14+
}
15+
]
16+
]
17+
}

ARCHITECTURE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,27 @@ mcp-server-ragdocs/
6262

6363
## Design Decisions
6464

65+
- **Semantic Versioning**: Strict adherence to SemVer through commit conventions and automated releases
6566
- Modular architecture for easy embedding provider swaps
6667
- Batch processing for scalability
6768
- Type-safe implementation with TypeScript
6869
- Convention-over-configuration for handler registration
70+
- npm package manager enforcement via engine-strict configuration
71+
72+
## CI/CD Pipeline
73+
74+
### Release Workflow
75+
76+
1. Semantic-release analyzes commits
77+
2. Automatically bumps version based on commit types
78+
3. Generates changelog
79+
4. Publishes to npm registry
80+
5. Creates GitHub release
81+
82+
### Quality Gates
83+
84+
- All tests must pass
85+
- 100% code coverage enforcement
86+
- Linting/formatting checks
87+
- Commit message validation
88+
- Dependency vulnerability scanning

0 commit comments

Comments
 (0)