Skip to content

Commit 2ec1e16

Browse files
committed
docs: update documentation for CI/CD improvements
- Add npm scripts section to README Development - Update Releasing section with changelog generation details - Add /release-note and /skip-changelog command documentation - Add Preview Changelog workflow instructions - Update COMMIT_CONVENTION.md with release notes section
1 parent 5b47b25 commit 2ec1e16

2 files changed

Lines changed: 104 additions & 14 deletions

File tree

README.md

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,29 @@ dtvem install
523523
npm install
524524
```
525525

526+
### npm Scripts
527+
528+
Development tasks are available via npm:
529+
530+
| Script | Description |
531+
|--------|-------------|
532+
| `npm run format` | Format all Go source files |
533+
| `npm run lint` | Run golangci-lint |
534+
| `npm run test` | Run all tests |
535+
| `npm run test:coverage` | Run tests with coverage report |
536+
| `npm run build` | Build both CLI and shim binaries |
537+
| `npm run install` | Build and install to ~/.dtvem/bin |
538+
| `npm run clean` | Clean build artifacts |
539+
| `npm run check` | Run format, lint, and test |
540+
526541
### Building
527542

528543
```bash
529-
# Build main executable
530-
go build -o dist/dtvem.exe ./src
544+
# Using npm (recommended)
545+
npm run build
531546

532-
# Build shim executable
547+
# Or directly with Go
548+
go build -o dist/dtvem.exe ./src
533549
go build -o dist/dtvem-shim.exe ./src/cmd/shim
534550

535551
# Build for specific platforms
@@ -541,18 +557,14 @@ GOOS=windows GOARCH=amd64 go build -o dist/dtvem.exe ./src
541557
### Testing
542558

543559
```bash
544-
# Run all tests
545-
cd src && go test ./...
560+
# Using npm (recommended)
561+
npm run test
562+
npm run test:coverage
546563

547-
# Run tests for a specific package
564+
# Or directly with Go
565+
cd src && go test ./...
548566
cd src && go test ./internal/config -v
549-
550-
# Run tests with coverage
551567
cd src && go test -cover ./...
552-
553-
# Generate HTML coverage report
554-
cd src && go test -coverprofile=coverage.out ./...
555-
cd src && go tool cover -html=coverage.out -o coverage.html
556568
```
557569

558570
**Test Coverage (63+ tests):**
@@ -633,12 +645,16 @@ To create a new release:
633645

634646
1. **Ensure all tests pass locally:**
635647
```bash
636-
cd src && go test ./...
648+
npm run check
637649
```
638650

639651
2. **Commit and push your changes to `main` branch**
640652

641-
3. **Trigger the release workflow manually:**
653+
3. **Preview the changelog (optional):**
654+
- Go to [Actions → Preview Changelog](https://github.com/dtvem/dtvem/actions/workflows/preview-changelog.yml)
655+
- Click "Run workflow" to see what release notes will be generated
656+
657+
4. **Trigger the release workflow:**
642658
- Go to [Actions → Release](https://github.com/dtvem/dtvem/actions/workflows/release.yml)
643659
- Click "Run workflow"
644660
- Select the `main` branch
@@ -654,6 +670,26 @@ The release workflow will automatically:
654670
- Create a GitHub Release with binaries, install scripts, and changelog
655671
- **Important:** Release is only created if all tests pass on all platforms
656672

673+
### Release Notes Generation
674+
675+
Release notes are automatically generated from merged PRs since the last release:
676+
677+
**Categorization by Commit Type:**
678+
- 🐛 **Bug Fixes** - PRs with `fix` prefix
679+
-**Performance & Improvements** - PRs with `perf` or `refactor` prefix
680+
- 🎉 **New Features** - PRs with `feat` prefix
681+
- 🔧 **Maintenance** - PRs with `docs`, `style`, `test`, `build`, `ci`, or `chore` prefix
682+
- 📦 **Other** - Uncategorized PRs
683+
684+
**Format:** Each entry shows `- PR title (#issue)` sorted by issue number.
685+
686+
**Custom Highlights:** Add a `/release-note <message>` comment on any PR to feature it in the Highlights section:
687+
```
688+
/release-note Dark mode is now available! Toggle it in Settings > Appearance.
689+
```
690+
691+
**Excluding PRs:** Add a `/skip-changelog` comment on any PR to exclude it from release notes.
692+
657693
**Supported Release Platforms:**
658694
- Windows (amd64, arm64)
659695
- macOS (amd64, arm64)

docs/COMMIT_CONVENTION.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,60 @@ code --install-extension vivaxy.vscode-conventional-commits
252252

253253
**IntelliJ/GoLand**: Install the "Git Commit Template" plugin
254254

255+
## Release Notes
256+
257+
Release notes are automatically generated from merged PRs. The changelog workflow uses PR titles and linked issue numbers.
258+
259+
### Changelog Categories
260+
261+
PRs are categorized based on their conventional commit prefix:
262+
263+
| Category | Prefixes |
264+
|----------|----------|
265+
| 🐛 Bug Fixes | `fix` |
266+
| ⚡ Performance & Improvements | `perf`, `refactor` |
267+
| 🎉 New Features | `feat` |
268+
| 🔧 Maintenance | `docs`, `style`, `test`, `build`, `ci`, `chore` |
269+
| 📦 Other | Uncategorized |
270+
271+
### Entry Format
272+
273+
Each entry shows: `- PR title (#issue)` sorted by issue number within each category.
274+
275+
Example:
276+
```markdown
277+
### 🐛 Bug Fixes
278+
279+
- fix(init): use system path on windows for correct priority (#55)
280+
- fix(shim): propagate exit code instead of reporting failure (#59)
281+
282+
### 🎉 New Features
283+
284+
- feat(list): show all runtimes and indicate global version (#54)
285+
```
286+
287+
### Custom Highlights
288+
289+
To feature a PR in the "Highlights" section, add a `/release-note` comment on the PR:
290+
291+
```
292+
/release-note Shim binary is now 56% smaller with faster startup
293+
```
294+
295+
### Excluding PRs from Changelog
296+
297+
Add a `/skip-changelog` comment on any PR to exclude it from release notes. Useful for:
298+
- Documentation-only PRs
299+
- CI/CD changes
300+
- Minor refactors
301+
302+
### Preview Changelog
303+
304+
Preview release notes before creating a release:
305+
1. Go to [Actions → Preview Changelog](https://github.com/dtvem/dtvem/actions/workflows/preview-changelog.yml)
306+
2. Click "Run workflow"
307+
3. Review the generated changelog in the workflow output
308+
255309
## Resources
256310

257311
- [Conventional Commits Specification](https://www.conventionalcommits.org/)

0 commit comments

Comments
 (0)