-
Notifications
You must be signed in to change notification settings - Fork 171
ci: move to changesets for releases #4003
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
Saadnajmi
merged 27 commits into
microsoft:main
from
Saadnajmi:changesets-hybrid-mirrornx-kit
Feb 13, 2026
Merged
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
5d938e9
feat: implement hybrid changesets workflow (mirror rnx-kit)
Saadnajmi fda6d2b
lock
Saadnajmi f2e5d87
feat: add PR validation for changesets
Saadnajmi acddb3b
Apply suggestion from @tido64
Saadnajmi a373b59
fix config
Saadnajmi 496f6ab
docs(changeset): Switch to changesets
Saadnajmi b258a5e
Dont use github app yet, more updates
github-actions[bot] ca20bde
Add a bunch of validation
github-actions[bot] d444021
don't export token
github-actions[bot] 47d4ce0
Remove beachball references
github-actions[bot] 46ad0eb
Remove AI generated markdown, rename yaml
github-actions[bot] 0839381
remove check-changes
github-actions[bot] 6d00718
use zx
github-actions[bot] c43952b
Update pr.yml
Saadnajmi 034b203
remove check-changes, use yarn scripts
github-actions[bot] 0b2c320
Merge branch 'changesets-hybrid-mirrornx-kit' of github.com:Saadnajmi…
github-actions[bot] 381cb97
Update changesets-version.yml
Saadnajmi 369db4b
Update .github/workflows/pr.yml
Saadnajmi c124629
Apply suggestions from code review
Saadnajmi 918fdcf
update validate to use changeset:status
github-actions[bot] ef50eec
print changeset stdout
github-actions[bot] 5b9c89c
typo
github-actions[bot] 8a03d23
one version command
github-actions[bot] 6ac3c07
Merge branch 'changesets-hybrid-mirrornx-kit' of github.com:Saadnajmi…
github-actions[bot] 5a5aabd
use default title and commit
github-actions[bot] c23ad55
Rename 'changeset' script to 'change'
Saadnajmi 34ffd6a
yarn workspaces foreach to publish
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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
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,102 @@ | ||
| --- | ||
| "@fluentui-react-native/adapters": patch | ||
| "@fluentui-react-native/android-theme": patch | ||
| "@fluentui-react-native/apple-theme": patch | ||
| "@fluentui-react-native/avatar": patch | ||
| "@fluentui-react-native/badge": patch | ||
| "@fluentui-react-native/button": patch | ||
| "@fluentui-react-native/callout": patch | ||
| "@fluentui-react-native/checkbox": patch | ||
| "@fluentui-react-native/chip": patch | ||
| "@fluentui-react-native/codemods": patch | ||
| "@fluentui-react-native/composition": patch | ||
| "@fluentui-react-native/contextual-menu": patch | ||
| "@fluentui-react-native/default-theme": patch | ||
| "@fluentui-react-native/divider": patch | ||
| "@fluentui-react-native/drawer": patch | ||
| "@fluentui-react-native/dropdown": patch | ||
| "@fluentui-react-native/experimental-activity-indicator": patch | ||
| "@fluentui-react-native/experimental-appearance-additions": patch | ||
| "@fluentui-react-native/experimental-avatar": patch | ||
| "@fluentui-react-native/experimental-checkbox": patch | ||
| "@fluentui-react-native/experimental-expander": patch | ||
| "@fluentui-react-native/experimental-menu-button": patch | ||
| "@fluentui-react-native/experimental-native-date-picker": patch | ||
| "@fluentui-react-native/experimental-native-font-metrics": patch | ||
| "@fluentui-react-native/experimental-shadow": patch | ||
| "@fluentui-react-native/experimental-shimmer": patch | ||
| "@fluentui-react-native/focus-trap-zone": patch | ||
| "@fluentui-react-native/focus-zone": patch | ||
| "@fluentui-react-native/framework": patch | ||
| "@fluentui-react-native/framework-base": patch | ||
| "@fluentui-react-native/icon": patch | ||
| "@fluentui-react-native/immutable-merge": patch | ||
| "@fluentui-react-native/input": patch | ||
| "@fluentui-react-native/interactive-hooks": patch | ||
| "@fluentui-react-native/link": patch | ||
| "@fluentui-react-native/memo-cache": patch | ||
| "@fluentui-react-native/menu": patch | ||
| "@fluentui-react-native/menu-button": patch | ||
| "@fluentui-react-native/merge-props": patch | ||
| "@fluentui-react-native/notification": patch | ||
| "@fluentui-react-native/overflow": patch | ||
| "@fluentui-react-native/persona": patch | ||
| "@fluentui-react-native/persona-coin": patch | ||
| "@fluentui-react-native/popover": patch | ||
| "@fluentui-react-native/pressable": patch | ||
| "@fluentui-react-native/radio-group": patch | ||
| "@fluentui-react-native/separator": patch | ||
| "@fluentui-react-native/spinner": patch | ||
| "@fluentui-react-native/stack": patch | ||
| "@fluentui-react-native/styling-utils": patch | ||
| "@fluentui-react-native/switch": patch | ||
| "@fluentui-react-native/tablist": patch | ||
| "@fluentui-react-native/text": patch | ||
| "@fluentui-react-native/theme": patch | ||
| "@fluentui-react-native/theme-tokens": patch | ||
| "@fluentui-react-native/theme-types": patch | ||
| "@fluentui-react-native/themed-stylesheet": patch | ||
| "@fluentui-react-native/theming-utils": patch | ||
| "@fluentui-react-native/tokens": patch | ||
| "@fluentui-react-native/tooltip": patch | ||
| "@fluentui-react-native/use-slot": patch | ||
| "@fluentui-react-native/use-slots": patch | ||
| "@fluentui-react-native/use-styling": patch | ||
| "@fluentui-react-native/use-tokens": patch | ||
| "@fluentui-react-native/vibrancy-view": patch | ||
| "@fluentui-react-native/win32-theme": patch | ||
| "@fluentui/react-native": patch | ||
| "@uifabricshared/foundation-composable": patch | ||
| "@uifabricshared/foundation-compose": patch | ||
| "@uifabricshared/foundation-settings": patch | ||
| "@uifabricshared/foundation-tokens": patch | ||
| "@uifabricshared/theme-registry": patch | ||
| "@uifabricshared/themed-settings": patch | ||
| "@uifabricshared/theming-ramp": patch | ||
| "@uifabricshared/theming-react-native": patch | ||
| --- | ||
|
|
||
| # Migration from Beachball to Changesets | ||
|
|
||
| This changeset represents the migration from Beachball to Changesets for version management and consolidates all changes from 440+ beachball change files that were in the `change/` directory. | ||
|
|
||
| All 75 affected packages receive a patch version bump to acknowledge the accumulated changes from the beachball era. | ||
|
|
||
| ## What Changed | ||
|
|
||
| Going forward, all version management uses Changesets via `yarn changeset`. The following beachball infrastructure has been removed: | ||
|
|
||
| - ❌ 440+ beachball change files from `change/` directory | ||
| - ❌ `beachball` package dependency | ||
| - ❌ Beachball scripts from `package.json` | ||
| - ❌ `beachball.config.js` configuration file | ||
| - ❌ Beachball publish steps from Azure Pipelines | ||
|
|
||
| ## New Workflow | ||
|
|
||
| ✅ **Create changes**: Run `yarn changeset` to document changes | ||
| ✅ **Version bump PRs**: Automatically created by GitHub Actions | ||
| ✅ **Publishing**: Handled by Azure Pipelines using `changeset publish` | ||
| ✅ **Validation**: CI validates changesets and blocks major version bumps | ||
|
|
||
| For details, see `CHANGESETS_SETUP.md` and `CONTRIBUTING.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,17 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json", | ||
| "changelog": "@changesets/cli/changelog", | ||
| "commit": ["@changesets/cli/commit", { "skipCI": false }], | ||
| "linked": [], | ||
| "access": "public", | ||
| "baseBranch": "origin/main", | ||
| "ignore": [ | ||
| "@fluentui-react-native/dependency-profiles", | ||
| "@fluentui-react-native/e2e-testing", | ||
| "@fluentui-react-native/tester", | ||
| "@fluentui-react-native/tester-core", | ||
| "@fluentui-react-native/tester-win32", | ||
| "@fluentui-react-native/tester-win32-81", | ||
| "@fluentui-react-native/test-*" | ||
| ] | ||
| } |
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,38 @@ | ||
| #!/usr/bin/env zx | ||
| import 'zx/globals'; | ||
|
|
||
| /** | ||
| * Changeset version bump with post-bump hook | ||
| * | ||
| * This script orchestrates the version bump process: | ||
| * 1. Runs changeset version to bump package versions | ||
| * 2. Updates dependency-profiles with new versions | ||
| * 3. Updates yarn.lock to reflect all changes | ||
| * | ||
| * The changesets action will automatically commit these changes. | ||
| */ | ||
|
|
||
| const DEPENDENCY_PROFILES_DIR = 'packages/dependency-profiles'; | ||
|
|
||
| echo('📦 Running changeset version...'); | ||
| await $`yarn changeset version`; | ||
|
Saadnajmi marked this conversation as resolved.
|
||
|
|
||
| // Undo the commit that changeset version made, but keep the changes | ||
| // This allows the changesets action to create a single commit with all changes | ||
| echo('🔙 Undoing changeset commit (keeping changes)...'); | ||
| await $`git reset --soft HEAD~1`; | ||
|
|
||
| echo('\n🔄 Updating dependency-profiles...'); | ||
| if (fs.existsSync(DEPENDENCY_PROFILES_DIR)) { | ||
| cd(DEPENDENCY_PROFILES_DIR); | ||
| await $`yarn update-profile`; | ||
| cd('../..'); | ||
| echo('✅ dependency-profiles updated'); | ||
| } else { | ||
| echo('⚠️ dependency-profiles not found, skipping'); | ||
| } | ||
|
|
||
| echo('\n🔒 Updating yarn.lock...'); | ||
| await $`yarn install --mode update-lockfile`; | ||
|
|
||
| echo('\n✅ Version bump complete!'); | ||
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,117 @@ | ||
| #!/usr/bin/env zx | ||
| import 'zx/globals'; | ||
|
|
||
| /** | ||
| * Validate changesets in CI | ||
| * | ||
| * Checks: | ||
| * 1. Changesets are present (PRs require changesets) | ||
| * 2. No major version bumps (breaking changes disallowed) | ||
| */ | ||
|
|
||
| // ANSI color codes | ||
| const colors = { | ||
| red: (msg: string) => `\x1b[31m${msg}\x1b[0m`, | ||
| green: (msg: string) => `\x1b[32m${msg}\x1b[0m`, | ||
| yellow: (msg: string) => `\x1b[33m${msg}\x1b[0m`, | ||
| }; | ||
|
|
||
| // Logging helpers | ||
| const log = { | ||
| error: (msg: string) => echo(colors.red(msg)), | ||
| success: (msg: string) => echo(colors.green(msg)), | ||
| warn: (msg: string) => echo(colors.yellow(msg)), | ||
| info: (msg: string) => echo(msg), | ||
| }; | ||
|
|
||
| interface ChangesetStatusOutput { | ||
| releases: Array<{ | ||
| name: string; | ||
| type: 'major' | 'minor' | 'patch' | 'none'; | ||
| oldVersion: string; | ||
| newVersion: string; | ||
| changesets: string[]; | ||
| }>; | ||
| changesets: string[]; | ||
| } | ||
|
|
||
| async function checkChangesetPresence() { | ||
| log.info('\n🔍 Checking for changeset presence...\n'); | ||
|
|
||
| const result = await $`yarn changeset status --since=origin/main 2>&1`.nothrow(); | ||
|
|
||
| if (result.exitCode !== 0) { | ||
| log.error('❌ Changeset validation failed\n'); | ||
| echo(result.stdout); | ||
| return false; | ||
| } | ||
|
|
||
| log.success('✅ Changesets found'); | ||
| return true; | ||
| } | ||
|
|
||
| async function checkForMajorBumps() { | ||
| log.info('\n🔍 Checking for major version bumps...\n'); | ||
|
|
||
| const result = await $`yarn changeset status --output bumps.json`.nothrow(); | ||
|
|
||
| // If no changesets, skip major bump check | ||
| if (result.exitCode !== 0 && result.stdout.includes('no changesets were found')) { | ||
| log.warn('No changesets found (skipping major check)'); | ||
| return true; | ||
| } | ||
|
|
||
| // Other errors | ||
| if (result.exitCode !== 0 || !fs.existsSync('bumps.json')) { | ||
| log.error('❌ Failed to check for major bumps\n'); | ||
| if (result.stderr) log.info(result.stderr); | ||
| return false; | ||
| } | ||
|
|
||
| const bumpsData: ChangesetStatusOutput = JSON.parse(fs.readFileSync('bumps.json', 'utf-8')); | ||
| fs.unlinkSync('bumps.json'); | ||
|
|
||
| const majorBumps = bumpsData.releases.filter(release => release.type === 'major'); | ||
|
|
||
| if (majorBumps.length > 0) { | ||
| log.error('❌ Major version bumps detected!\n'); | ||
| for (const release of majorBumps) { | ||
| log.error(` ${release.name}: major`); | ||
| if (release.changesets.length > 0) { | ||
| log.error(` (from changesets: ${release.changesets.join(', ')})`); | ||
| } | ||
| } | ||
| log.error('\nMajor version bumps are not allowed.'); | ||
| log.warn('If you need to make a breaking change, please discuss with the team first.\n'); | ||
| return false; | ||
| } | ||
|
|
||
| log.success('✅ No major version bumps found'); | ||
| return true; | ||
| } | ||
|
|
||
| // Main execution | ||
| log.info(`\n${'='.repeat(60)}`); | ||
| log.info('Changesets Validation'); | ||
| log.info(`${'='.repeat(60)}`); | ||
|
|
||
| const results = { | ||
| presence: await checkChangesetPresence(), | ||
| majorBumps: await checkForMajorBumps(), | ||
| }; | ||
|
|
||
| log.info(`\n${'='.repeat(60)}`); | ||
| log.info('Validation Results:'); | ||
| log.info(`${'='.repeat(60)}\n`); | ||
|
|
||
| log.info(`Changeset presence: ${results.presence ? '✅ PASS' : '❌ FAIL'}`); | ||
| log.info(`Major version check: ${results.majorBumps ? '✅ PASS' : '❌ FAIL'}\n`); | ||
|
|
||
| const allPassed = results.presence && results.majorBumps; | ||
|
|
||
| if (!allPassed) { | ||
| log.error('Validation failed!\n'); | ||
| throw new Error('Validation failed'); | ||
| } | ||
|
|
||
| log.success('All validations passed! ✅\n'); |
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,54 @@ | ||
| name: Changesets Version Bump | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
|
|
||
| jobs: | ||
| version: | ||
| name: Create Version Bump PR | ||
| runs-on: ubuntu-latest | ||
|
|
||
| # Remove this once we setup react-native-sdk[bot] with this repo | ||
| permissions: | ||
| contents: write # for GH releases and Git tags (Changesets) | ||
| pull-requests: write # version PRs (Changesets) | ||
|
|
||
| if: ${{ github.repository == 'microsoft/fluentui-react-native' }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up toolchain | ||
| uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@5.0.14 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| yarn install --immutable | ||
|
|
||
| - name: Build packages | ||
| run: yarn buildci | ||
|
|
||
| # Bring this back once we setup react-native-sdk[bot] with this repo | ||
| # - name: Generate token for version PR | ||
| # uses: actions/create-github-app-token@v2 | ||
| # id: app-token | ||
| # with: | ||
| # app-id: ${{ vars.APP_ID }} | ||
| # private-key: ${{ secrets.PRIVATE_KEY }} | ||
| # permissions: | | ||
| # contents: write | ||
| # pull-requests: write | ||
|
|
||
| - name: Create Version Bump PR | ||
| id: changesets | ||
| uses: changesets/action@v1 | ||
| with: | ||
| version: yarn changeset:version | ||
| createGithubReleases: false | ||
| env: | ||
| # Switch token once we setup react-native-sdk[bot] with this repo | ||
| # GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_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.
Uh oh!
There was an error while loading. Please reload this page.