@@ -124,25 +124,34 @@ async function main() {
124124 throw new Error ( `Unknown release channel ${ argv . releaseChannel } ` ) ;
125125 }
126126 } else {
127- // Running locally, no concurrency. Move each channel's build artifacts into
128- // a temporary directory so that they don't conflict.
129- buildForChannel ( 'stable' , '' , '' ) ;
130- const stableDir = tmp . dirSync ( ) . name ;
131- crossDeviceRenameSync ( './build' , stableDir ) ;
132- processStable ( stableDir ) ;
133- buildForChannel ( 'experimental' , '' , '' ) ;
134- const experimentalDir = tmp . dirSync ( ) . name ;
135- crossDeviceRenameSync ( './build' , experimentalDir ) ;
136- processExperimental ( experimentalDir ) ;
137-
138- // Then merge the experimental folder into the stable one. processExperimental
139- // will have already removed conflicting files.
140- //
141- // In CI, merging is handled by the GitHub Download Artifacts plugin.
142- mergeDirsSync ( experimentalDir + '/' , stableDir + '/' ) ;
143-
144- // Now restore the combined directory back to its original name
145- crossDeviceRenameSync ( stableDir , './build' ) ;
127+ const releaseChannel = argv . releaseChannel ;
128+ if ( releaseChannel === 'stable' ) {
129+ buildForChannel ( 'stable' , '' , '' ) ;
130+ processStable ( './build' ) ;
131+ } else if ( releaseChannel === 'experimental' ) {
132+ buildForChannel ( 'experimental' , '' , '' ) ;
133+ processExperimental ( './build' ) ;
134+ } else {
135+ // Running locally, no concurrency. Move each channel's build artifacts into
136+ // a temporary directory so that they don't conflict.
137+ buildForChannel ( 'stable' , '' , '' ) ;
138+ const stableDir = tmp . dirSync ( ) . name ;
139+ crossDeviceRenameSync ( './build' , stableDir ) ;
140+ processStable ( stableDir ) ;
141+ buildForChannel ( 'experimental' , '' , '' ) ;
142+ const experimentalDir = tmp . dirSync ( ) . name ;
143+ crossDeviceRenameSync ( './build' , experimentalDir ) ;
144+ processExperimental ( experimentalDir ) ;
145+
146+ // Then merge the experimental folder into the stable one. processExperimental
147+ // will have already removed conflicting files.
148+ //
149+ // In CI, merging is handled by the GitHub Download Artifacts plugin.
150+ mergeDirsSync ( experimentalDir + '/' , stableDir + '/' ) ;
151+
152+ // Now restore the combined directory back to its original name
153+ crossDeviceRenameSync ( stableDir , './build' ) ;
154+ }
146155 }
147156}
148157
0 commit comments