Skip to content

Commit 322cb6e

Browse files
Copilot8enSmith
andcommitted
feat: implement semantic-release for automated versioning and publishing
Co-authored-by: 8enSmith <798183+8enSmith@users.noreply.github.com>
1 parent 2bf80bb commit 322cb6e

File tree

7 files changed

+8557
-2313
lines changed

7 files changed

+8557
-2313
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches-ignore: [main]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Lint
28+
run: npm run lint
29+
30+
- name: Run tests
31+
run: npm run test:precommit
32+
33+
- name: Build
34+
run: npm run build

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Run tests
28+
run: npm run test:precommit
29+
30+
- name: Build
31+
run: npm run build
32+
33+
- name: Release
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
run: npm run semantic-release

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
build/
3-
mcp-open-library-*.tgz
3+
mcp-open-library-*.tgz
4+
CHANGELOG.md

.releaserc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
"@semantic-release/commit-analyzer",
7+
"@semantic-release/release-notes-generator",
8+
"@semantic-release/changelog",
9+
"@semantic-release/npm",
10+
"@semantic-release/git",
11+
"@semantic-release/github"
12+
]
13+
}

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,24 @@ npm run inspector http://localhost:8080
254254
- `npm test` - Run the test suite
255255
- `npm run format` - Format code with Prettier
256256
- `npm run inspector` - Run the MCP Inspector against the server
257+
- `npm run semantic-release` - Run semantic release (automated in CI)
257258

258259
### Running Tests
259260

260261
```bash
261262
npm test
262263
```
263264

265+
### Releases
266+
267+
This project uses [semantic-release](https://semantic-release.gitbook.io/) for automated versioning and publishing. Releases are automatically created when commits are pushed to the `main` branch using [conventional commit messages](https://www.conventionalcommits.org/).
268+
269+
Commit message format:
270+
- `feat:` - new features (triggers minor version bump)
271+
- `fix:` - bug fixes (triggers patch version bump)
272+
- `feat!:` or `fix!:` - breaking changes (triggers major version bump)
273+
- `docs:`, `style:`, `refactor:`, `test:`, `chore:` - no version bump
274+
264275
## Contributing
265276

266277
Contributions are welcome! Please feel free to submit a pull request.

0 commit comments

Comments
 (0)