forked from microsoft/fluentui-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangeset-version-with-postbump.mts
More file actions
38 lines (31 loc) · 1.14 KB
/
changeset-version-with-postbump.mts
File metadata and controls
38 lines (31 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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`;
// 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!');