Skip to content

Commit f848e7c

Browse files
authored
Merge pull request #142 from drivecore/feat/140-conventional-commits
feat(release): implement conventional commits approach
2 parents 47fd9e8 + 66e059d commit f848e7c

16 files changed

+2399
-77
lines changed

.changeset/README.md

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

.changeset/config.json

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

.changeset/itchy-hounds-cross.md

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

.changeset/new-nails-search.md

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

.github/workflows/issue-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ jobs:
5959
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
6060
run: |
6161
echo "Running MyCoder for issue #${{ github.event.issue.number }} with prompt: ${{ steps.extract-prompt.outputs.prompt }}"
62-
mycoder --githubMode true --userPrompt false "On issue #${{ github.event.issue.number }} the user asked: '${{ steps.extract-prompt.outputs.prompt }}' in comment ${{ steps.extract-prompt.outputs.comment_url }}. Please address this request. If you create a PR or take actions outside the scope of this issue, please report back to the issue with a comment explaining what you did."
62+
mycoder --githubMode true --userPrompt false "On issue #${{ github.event.issue.number }} the user asked: '${{ steps.extract-prompt.outputs.prompt }}' in comment ${{ steps.extract-prompt.outputs.comment_url }}. Please address this request. If you create a PR or take actions outside the scope of this issue, please report back to the issue with a comment explaining what you did."

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
8+
permissions:
9+
contents: write
10+
issues: write
11+
pull-requests: write
12+
packages: write
13+
14+
env:
15+
PNPM_VERSION: 10.2.1
16+
NODE_VERSION: 23
17+
18+
jobs:
19+
release:
20+
name: Release
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
with:
26+
fetch-depth: 0
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v2
31+
with:
32+
version: ${{ env.PNPM_VERSION }}
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: ${{ env.NODE_VERSION }}
38+
cache: 'pnpm'
39+
40+
- name: Install dependencies
41+
run: pnpm install --frozen-lockfile
42+
43+
- name: Build
44+
run: pnpm build
45+
46+
- name: Install browsers
47+
run: cd packages/agent && pnpm exec playwright install --with-deps chromium
48+
49+
- name: Test
50+
run: pnpm test
51+
52+
- name: Release
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
56+
run: pnpm semantic-release

.gitmessage

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# <type>(<scope>): <subject>
2+
# |<---- Using a maximum of 50 characters ---->|
3+
4+
# Explain why this change is being made
5+
# |<---- Try to limit each line to a maximum of 72 characters ---->|
6+
7+
# Provide links or keys to any relevant tickets, articles or other resources
8+
# Example: Github issue #23
9+
10+
# --- COMMIT END ---
11+
# Type can be
12+
# feat (new feature)
13+
# fix (bug fix)
14+
# docs (changes to documentation)
15+
# style (formatting, missing semi colons, etc; no code change)
16+
# refactor (refactoring production code)
17+
# test (adding missing tests, refactoring tests; no production code change)
18+
# chore (updating grunt tasks etc; no production code change)
19+
# --------------------
20+
# Remember to
21+
# - Capitalize the subject line
22+
# - Use the imperative mood in the subject line
23+
# - Do not end the subject line with a period
24+
# - Separate subject from body with a blank line
25+
# - Use the body to explain what and why vs. how
26+
# - Can use multiple lines with "-" for bullet points in body
27+
# --------------------

.husky/commit-msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Validate commit message with commitlint
2+
npx --no -- commitlint --edit $1

.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+
[
9+
"@semantic-release/git",
10+
{
11+
"assets": ["package.json", "CHANGELOG.md"],
12+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
13+
}
14+
],
15+
"@semantic-release/github"
16+
]
17+
}

CONTRIBUTING.md

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,43 @@ This project and everyone participating in it is governed by our Code of Conduct
7272
4. Commit your changes:
7373

7474
```bash
75-
git commit -m "feat: add your feature description"
75+
git commit
7676
```
7777

78-
Follow [Conventional Commits](https://www.conventionalcommits.org/) specification.
78+
We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for our commit messages:
79+
80+
- **feat**: A new feature
81+
- **fix**: A bug fix
82+
- **docs**: Documentation only changes
83+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, etc)
84+
- **refactor**: A code change that neither fixes a bug nor adds a feature
85+
- **perf**: A code change that improves performance
86+
- **test**: Adding missing tests or correcting existing tests
87+
- **chore**: Changes to the build process or auxiliary tools and libraries
88+
89+
Each commit message should be structured as follows:
90+
91+
```
92+
<type>[optional scope]: <description>
93+
94+
[optional body]
95+
96+
[optional footer(s)]
97+
```
98+
99+
Example:
100+
101+
```
102+
feat(auth): implement JWT authentication
103+
104+
- Add JWT token generation
105+
- Add token validation middleware
106+
- Update user routes to use authentication
107+
108+
Closes #123
109+
```
110+
111+
We have set up a commit message template and commitlint to help you follow this convention.
79112

80113
5. Push to your fork and create a Pull Request
81114

@@ -161,9 +194,18 @@ This project and everyone participating in it is governed by our Code of Conduct
161194

162195
## Release Process
163196

164-
1. Maintainers will handle releases
165-
2. Follow semantic versioning
166-
3. Update changelog entries
167-
4. Tag releases appropriately
197+
1. Releases are automated through our CI/CD pipeline
198+
2. When code is merged to the main branch, semantic-release:
199+
- Determines the next version based on conventional commit messages
200+
- Generates a changelog from commit messages
201+
- Creates a GitHub Release with the changelog
202+
- Tags the release
203+
- Publishes to NPM
204+
3. No manual release steps are required
205+
4. Ensure your commit messages follow the conventional commits format to trigger appropriate version bumps:
206+
- `feat:` commits trigger a minor version bump
207+
- `fix:` commits trigger a patch version bump
208+
- `perf:` commits trigger a patch version bump
209+
- Commits with `BREAKING CHANGE:` in the footer trigger a major version bump
168210

169211
Thank you for contributing to MyCoder! 👍

0 commit comments

Comments
 (0)