File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -106,11 +106,6 @@ export async function release(options: ReleaseOptions = {}): Promise<void> {
106106 // Set environment variable for build scripts
107107 process . env . RELEASE_VERSION = version ;
108108
109- // Run build script if specified
110- if ( build ) {
111- await runBuildScript ( build , cwd , dryRun ) ;
112- }
113-
114109 // Load workspace packages
115110 const packages = await loadWorkspacePackages ( cwd ) ;
116111
@@ -133,7 +128,8 @@ export async function release(options: ReleaseOptions = {}): Promise<void> {
133128 return ;
134129 }
135130
136- // Update all package versions (without committing)
131+ // Update all package versions FIRST (before build)
132+ // This ensures build scripts can read the correct version from package.json
137133 packages . forEach ( ( pkg ) => {
138134 const packageJsonPath = join ( pkg . dir , 'package.json' ) ;
139135 if ( dryRun ) {
@@ -161,6 +157,11 @@ export async function release(options: ReleaseOptions = {}): Promise<void> {
161157 }
162158 }
163159
160+ // Run build script if specified (now with updated version)
161+ if ( build ) {
162+ await runBuildScript ( build , cwd , dryRun ) ;
163+ }
164+
164165 // Publish packages with workspace dependency management
165166 // Dependency replacement is handled within publishPackages to avoid duplication
166167 await publishPackages (
Original file line number Diff line number Diff line change @@ -34,4 +34,4 @@ export async function runBuildScript(
3434 stdio : 'inherit' ,
3535 env : process . env ,
3636 } ) ;
37- }
37+ }
You can’t perform that action at this time.
0 commit comments