Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release Please

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
17 changes: 14 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Publish to npm

on:
push:
Expand Down Expand Up @@ -26,9 +26,20 @@ jobs:
node-version: 20.11.1
registry-url: 'https://registry.npmjs.org/'

- run: pnpm install
- run: pnpm install --frozen-lockfile

- name: Validate tag and package version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PKG_VERSION="$(node -p "require('./packages/react/package.json').version")"

if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "Tag version ($TAG_VERSION) does not match package version ($PKG_VERSION)."
exit 1
fi

- run: pnpm build
- run: pnpm test
- run: pnpm --filter react-virtualized-diff publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"packages/react": "0.1.2"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project follows Semantic Versioning.

## [0.1.2] - 2026-04-06

### Added

- Added `release-please` workflow to automatically create version/changelog release PRs from conventional commits
- Added release manifest/config to keep package versioning source-of-truth in repository metadata

### Changed

- Updated publish workflow to validate git tag version against `packages/react/package.json` before npm publish
- Release flow now supports automated patch/minor bumps without manually editing workflow version values

## [0.1.1] - 2026-04-06

### Added
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ See [CHANGELOG.md](./CHANGELOG.md) for tracked releases and supported capabiliti

---

## Automated versioning & release

This repository now uses **Release Please** to automate versioning and changelog generation.

- Merge commits to `main` using Conventional Commits (`fix:`, `feat:`, `feat!:` etc.)
- Release Please opens/updates a release PR automatically
- Merging that PR creates a `vX.Y.Z` tag and GitHub Release
- npm publish workflow is triggered by that tag and publishes `react-virtualized-diff` automatically

Version bump rules (SemVer):

- `fix:`/`chore:` and similar => patch (`v0.1.x` -> `v0.1.x+1`)
- `feat:` => minor (`v0.1.x` -> `v0.2.0`)
- `feat!:` or `BREAKING CHANGE:` => major (`v0.x.x` -> `v1.0.0`)

## Future plan

### Near-term roadmap
Expand All @@ -133,7 +148,7 @@ See [CHANGELOG.md](./CHANGELOG.md) for tracked releases and supported capabiliti
- [ ] Dark/light theme presets and design tokens
- [ ] SSR usage guide (Next.js / Remix examples)
- [ ] More real-world examples (JSON, logs, markdown, code)
- [ ] CI release automation + semantic versioning workflow
- [x] CI release automation + semantic versioning workflow
- [ ] Contribution guide and issue templates
- [ ] International docs beyond English/Chinese

Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-virtualized-diff",
"version": "0.1.1",
"version": "0.1.2",
"description": "High-performance React diff viewer for large files",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
Expand Down
11 changes: 11 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-component-in-tag": false,
"packages": {
"packages/react": {
"release-type": "node",
"package-name": "react-virtualized-diff",
"changelog-path": "CHANGELOG.md"
}
}
}
Loading