Skip to content

Commit 2dfde25

Browse files
feat: add semantic-release and automated CI/CD pipeline
- Add semantic-release configuration for automated versioning - Set up automated releases based on conventional commits - Add CONTRIBUTING.md with development guidelines - Update CI workflow to support automated releases - Improve test fixtures and enhance test coverage - Refactor CSS fix suggester and smart pairing logic - Update package.json with release scripts and dependencies
1 parent 1a07302 commit 2dfde25

20 files changed

Lines changed: 9396 additions & 3134 deletions

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ jobs:
100100
- name: Build project
101101
run: npm run build
102102

103-
# Uncomment when ready to publish to npm
104-
# - name: Publish to npm
105-
# run: npm publish
106-
# env:
107-
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
103+
- name: Semantic Release
104+
run: npx semantic-release
105+
env:
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.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", "package-lock.json"],
13+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
14+
}
15+
]
16+
]
17+
}

CONTRIBUTING.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Contributing to auto-image-diff
2+
3+
## Commit Message Convention
4+
5+
This project uses [Conventional Commits](https://www.conventionalcommits.org/) for automated versioning and changelog generation.
6+
7+
### Commit Message Format
8+
9+
```
10+
<type>[optional scope]: <description>
11+
12+
[optional body]
13+
14+
[optional footer(s)]
15+
```
16+
17+
### Types
18+
19+
- **feat**: A new feature (triggers minor version bump)
20+
- **fix**: A bug fix (triggers patch version bump)
21+
- **docs**: Documentation only changes
22+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
23+
- **refactor**: A code change that neither fixes a bug nor adds a feature
24+
- **perf**: A code change that improves performance
25+
- **test**: Adding missing tests or correcting existing tests
26+
- **chore**: Changes to the build process or auxiliary tools and libraries
27+
28+
### Breaking Changes
29+
30+
Add `BREAKING CHANGE:` in the commit footer or `!` after the type to trigger a major version bump:
31+
32+
```
33+
feat!: remove deprecated API methods
34+
35+
BREAKING CHANGE: The deprecated methods `oldMethod()` and `anotherOldMethod()` have been removed.
36+
```
37+
38+
### Examples
39+
40+
```
41+
feat: add CSS fix suggestion feature
42+
fix: resolve image alignment issues with rotated images
43+
docs: update API documentation with new examples
44+
perf: optimize batch processing for large image sets
45+
feat(classifier): add new edge detection algorithm
46+
fix(batch): handle empty directory gracefully
47+
```
48+
49+
## Automated Releases
50+
51+
This project uses [semantic-release](https://github.com/semantic-release/semantic-release) for automated versioning and publishing:
52+
53+
- **Patch releases** (1.0.X) for bug fixes
54+
- **Minor releases** (1.X.0) for new features
55+
- **Major releases** (X.0.0) for breaking changes
56+
57+
Releases are automatically created when commits are pushed to the `main` branch, based on the conventional commits since the last release.
58+
59+
## Development Workflow
60+
61+
1. Create a feature branch from `main`
62+
2. Make your changes using conventional commit messages
63+
3. Run tests: `npm test`
64+
4. Run linting: `npm run lint`
65+
5. Submit a pull request to `main`
66+
6. After review and merge, the release will be automated
67+
68+
## Testing Releases Locally
69+
70+
You can test what version would be released without actually releasing:
71+
72+
```bash
73+
npm run release:dry-run
74+
```
75+
76+
This will show you:
77+
78+
- What version would be bumped to
79+
- What changelog entries would be generated
80+
- Whether the release would be published

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,28 @@ Contributions are welcome! Please:
396396

397397
1. Fork the repository
398398
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
399-
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
399+
3. Commit your changes using [Conventional Commits](https://www.conventionalcommits.org/) (`git commit -m 'feat: add amazing feature'`)
400400
4. Push to the branch (`git push origin feature/amazing-feature`)
401401
5. Open a Pull Request
402402

403+
### 📋 Commit Convention
404+
405+
This project uses [Conventional Commits](https://www.conventionalcommits.org/) for automated versioning and changelog generation:
406+
407+
- `feat:` - New features (minor version bump)
408+
- `fix:` - Bug fixes (patch version bump)
409+
- `docs:` - Documentation changes
410+
- `style:` - Code formatting changes
411+
- `refactor:` - Code changes that neither fix bugs nor add features
412+
- `test:` - Adding or updating tests
413+
- `chore:` - Build process or auxiliary tool changes
414+
415+
For breaking changes, add `!` after the type: `feat!: remove deprecated API`
416+
417+
### 🔄 Automated Releases
418+
419+
This project uses [semantic-release](https://github.com/semantic-release/semantic-release) for automated versioning and publishing. When commits are merged to `main`, releases are automatically created based on the conventional commit messages. See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.
420+
403421
### Development Setup
404422

405423
```bash

0 commit comments

Comments
 (0)