-
Notifications
You must be signed in to change notification settings - Fork 0
Add changesets and automated release workflow #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e2482a6
Initial plan
Copilot a7a47e8
Add changesets and automated release workflow
Copilot 7af9b7e
Add changeset check workflow and update documentation
Copilot 8ae83d6
Add comprehensive changeset setup documentation
Copilot 04fc152
Fix security: Add explicit permissions to changeset-check workflow
Copilot 993fc58
Merge branch 'main' into copilot/add-changeset-and-automation
hotlong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # Changesets | ||
|
|
||
| This directory contains changeset files that track changes to packages in the Object UI monorepo. | ||
|
|
||
| ## What are Changesets? | ||
|
|
||
| Changesets are a way to declare your intent to release packages. They help us: | ||
| - Track which packages have changed | ||
| - Determine appropriate version bumps (major, minor, patch) | ||
| - Generate comprehensive changelogs | ||
| - Automate the release process | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ### Creating a Changeset | ||
|
|
||
| When you make changes to packages, run: | ||
|
|
||
| ```bash | ||
| pnpm changeset | ||
| ``` | ||
|
|
||
| This will guide you through: | ||
| 1. Selecting which packages changed | ||
| 2. Choosing the type of version bump | ||
| 3. Writing a description of the changes | ||
|
|
||
| ### Example | ||
|
|
||
| ```bash | ||
| $ pnpm changeset | ||
|
|
||
| 🦋 Which packages would you like to include? | ||
| ◉ @object-ui/react | ||
| ◯ @object-ui/core | ||
| ◯ @object-ui/components | ||
|
|
||
| 🦋 What kind of change is this for @object-ui/react? | ||
| ◯ major (breaking change) | ||
| ◉ minor (new feature) | ||
| ◯ patch (bug fix) | ||
|
|
||
| 🦋 Please enter a summary for this change: | ||
| Add support for custom validators in form components | ||
| ``` | ||
|
|
||
| ### When to Create a Changeset | ||
|
|
||
| ✅ **DO** create a changeset for: | ||
| - New features | ||
| - Bug fixes | ||
| - Breaking changes | ||
| - Performance improvements | ||
| - API changes | ||
|
|
||
| ❌ **DON'T** create a changeset for: | ||
| - Documentation updates | ||
| - Changes to examples or apps | ||
| - Internal refactoring with no API changes | ||
| - Test-only updates | ||
|
|
||
| ## Automated Release Process | ||
|
|
||
| 1. **Merge PR with changeset** → Triggers automation | ||
| 2. **Bot creates "Version Packages" PR** → Updates versions and changelogs | ||
| 3. **Merge Version PR** → Automatically publishes to npm | ||
|
|
||
| ## Learn More | ||
|
|
||
| - [Full Changesets Documentation](https://github.com/changesets/changesets) | ||
| - [Object UI Contributing Guide](../CONTRIBUTING.md#versioning-and-releases) | ||
| - [Common Questions](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json", | ||
| "changelog": "@changesets/cli/changelog", | ||
| "commit": false, | ||
| "fixed": [], | ||
| "linked": [], | ||
| "access": "public", | ||
| "baseBranch": "main", | ||
| "updateInternalDependencies": "patch", | ||
| "ignore": [ | ||
| "@apps/*", | ||
| "@examples/*" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: Changeset Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, labeled, unlabeled] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Check for Changeset | ||
| runs-on: ubuntu-latest | ||
| # Skip this check if PR has 'skip-changeset' label or only changes non-package files | ||
| if: | | ||
| !contains(github.event.pull_request.labels.*.name, 'skip-changeset') && | ||
| !contains(github.event.pull_request.labels.*.name, 'dependencies') | ||
|
|
||
| steps: | ||
| - name: Checkout Repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Check for changesets | ||
| run: | | ||
| # Check if there are any changesets | ||
| if [ ! "$(ls -A .changeset/*.md 2>/dev/null | grep -v 'README.md')" ]; then | ||
| # Check if any package files were changed | ||
| if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q '^packages/'; then | ||
| echo "❌ This PR modifies packages but doesn't include a changeset" | ||
| echo "" | ||
| echo "To add a changeset, run: pnpm changeset" | ||
| echo "" | ||
| echo "If this PR doesn't need a changeset (docs only, etc.)," | ||
| echo "add the 'skip-changeset' label to the PR" | ||
| echo "" | ||
| echo "📚 Learn more: https://github.com/objectstack-ai/objectui/blob/main/CONTRIBUTING.md#versioning-and-releases" | ||
| exit 1 | ||
| else | ||
| echo "✅ No package changes detected, skipping changeset check" | ||
| fi | ||
| else | ||
| echo "✅ Changeset found" | ||
| fi | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: Changeset Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Changeset Release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
| cache: 'pnpm' | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Run tests | ||
| run: pnpm test | ||
|
|
||
| - name: Build packages | ||
| run: pnpm build | ||
|
|
||
| - name: Create Release Pull Request or Publish to npm | ||
| id: changesets | ||
| uses: changesets/action@v1 | ||
| with: | ||
| version: pnpm changeset:version | ||
| publish: pnpm changeset:publish | ||
| title: 'chore: release packages' | ||
| commit: 'chore: release packages' | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ignore patterns use '@apps/' and '@examples/', but these don't match typical monorepo package naming conventions where packages are usually scoped with the organization name. Verify these patterns match the actual package names in your monorepo. If packages are named differently (e.g., 'apps/' or 'examples/' without the @ prefix), update the patterns accordingly.