File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const dir = fileURLToPath(new URL("..", import.meta.url))
88process . chdir ( dir )
99
1010const { binaries } = await import ( "./build.ts" )
11+ const dryRun = Boolean ( process . env [ "DRY_RUN" ] )
1112{
1213 const name = `${ pkg . name } -${ process . platform } -${ process . arch } `
1314 console . log ( `smoke test: running dist/${ name } /bin/opencode --version` )
@@ -41,14 +42,23 @@ for (const [name] of Object.entries(binaries)) {
4142 if ( process . platform !== "win32" ) {
4243 await $ `chmod 755 -R .`
4344 }
45+ if ( dryRun ) {
46+ console . log ( `DRY_RUN: skipping publish for ${ name } ` )
47+ continue
48+ }
4449 await $ `bun publish --access public --tag ${ Script . channel } `
4550 } finally {
4651 process . chdir ( dir )
4752 }
4853}
49- await $ `cd ./dist/${ pkg . name } && bun publish --access public --tag ${ Script . channel } `
54+ if ( dryRun ) {
55+ console . log ( `DRY_RUN: skipping publish for ${ pkg . name } -ai` )
56+ }
57+ if ( ! dryRun ) {
58+ await $ `cd ./dist/${ pkg . name } && bun publish --access public --tag ${ Script . channel } `
59+ }
5060
51- if ( ! Script . preview ) {
61+ if ( ! Script . preview && ! dryRun ) {
5262 const major = Script . version . split ( "." ) [ 0 ]
5363 const majorTag = `latest-${ major } `
5464 for ( const [ name ] of Object . entries ( binaries ) ) {
@@ -57,7 +67,7 @@ if (!Script.preview) {
5767 await $ `cd ./dist/${ pkg . name } && npm dist-tag add ${ pkg . name } -ai@${ Script . version } ${ majorTag } `
5868}
5969
60- if ( ! Script . preview ) {
70+ if ( ! Script . preview && ! dryRun ) {
6171 for ( const key of Object . keys ( binaries ) ) {
6272 await $ `cd dist/${ key } /bin && zip -r ../../${ key } .zip *`
6373 }
You can’t perform that action at this time.
0 commit comments