@@ -27,11 +27,6 @@ function tryRun(cmd: string, opts?: { cwd?: string; stdio?: "pipe" | "inherit" }
2727 }
2828}
2929
30- function isPublished ( name : string , version : string ) : boolean {
31- const { ok } = tryRun ( `npm view ${ name } @${ version } version` ) ;
32- return ok ;
33- }
34-
3530function fatal ( msg : string ) : never {
3631 console . error ( `\x1b[31mError:\x1b[0m ${ msg } ` ) ;
3732 process . exit ( 1 ) ;
@@ -155,13 +150,6 @@ async function main() {
155150 process . exit ( 0 ) ;
156151 }
157152
158- // Typecheck & build
159- console . log ( "\n\x1b[1mRunning typecheck...\x1b[0m" ) ;
160- run ( "pnpm turbo check-types" , { stdio : "inherit" } ) ;
161-
162- console . log ( "\n\x1b[1mRunning build...\x1b[0m" ) ;
163- run ( "pnpm turbo build" , { stdio : "inherit" } ) ;
164-
165153 // Bump versions
166154 console . log ( `\n\x1b[1mBumping versions to ${ version } ...\x1b[0m` ) ;
167155 setVersion ( ROOT , version ) ;
@@ -183,7 +171,7 @@ async function main() {
183171 console . log ( " No version changes to commit, skipping." ) ;
184172 }
185173
186- // Git tag & GitHub release
174+ // Git tag
187175 console . log ( `\n\x1b[1mCreating git tag v${ version } ...\x1b[0m` ) ;
188176 const tagExists = tryRun ( `git rev-parse v${ version } ` ) . ok ;
189177 if ( tagExists ) {
@@ -193,39 +181,12 @@ async function main() {
193181 run ( `git push origin v${ version } ` ) ;
194182 }
195183
196- const prerelease = tag === "rc" ? "--prerelease" : "" ;
197- const releaseExists = tryRun ( `gh release view v${ version } ` ) . ok ;
198- if ( releaseExists ) {
199- console . log ( ` GitHub release v${ version } already exists, skipping.` ) ;
200- } else {
201- console . log ( "\n\x1b[1mCreating GitHub release...\x1b[0m" ) ;
202- run (
203- `gh release create v${ version } --title "v${ version } " --generate-notes ${ prerelease } ` . trim ( ) ,
204- { stdio : "inherit" } ,
205- ) ;
206- }
207-
208- // Publish
209- console . log ( `\n\x1b[1mPublishing to npm (tag: ${ tag } )...\x1b[0m` ) ;
210- const failures : string [ ] = [ ] ;
211- for ( const pkg of packages ) {
212- const name = JSON . parse ( readFileSync ( join ( pkg , "package.json" ) , "utf-8" ) ) . name ;
213- if ( isPublished ( name , version ) ) {
214- console . log ( ` \x1b[33m⏭ ${ name } @${ version } already published, skipping.\x1b[0m` ) ;
215- continue ;
216- }
217- console . log ( ` Publishing ${ name } ...` ) ;
218- const { ok } = tryRun ( `pnpm publish --access public --tag ${ tag } --no-git-checks` , { cwd : pkg , stdio : "inherit" } ) ;
219- if ( ! ok ) {
220- failures . push ( name ) ;
221- }
222- }
223-
224- if ( failures . length > 0 ) {
225- fatal ( `Failed to publish: ${ failures . join ( ", " ) } ` ) ;
226- }
184+ // Trigger CI release workflow
185+ console . log ( `\n\x1b[1mTriggering CI release workflow...\x1b[0m` ) ;
186+ run ( `gh workflow run release.yml -f version=${ version } -f npm-tag=${ tag } ` , { stdio : "inherit" } ) ;
227187
228- console . log ( `\n\x1b[32m✓ Released v${ version } \x1b[0m` ) ;
188+ console . log ( `\n\x1b[32m✓ Tag v${ version } pushed — CI will handle publish + GitHub release.\x1b[0m` ) ;
189+ console . log ( ` Watch progress: \x1b[36mhttps://github.com/rivet-dev/secure-exec/actions/workflows/release.yml\x1b[0m` ) ;
229190}
230191
231192main ( ) . catch ( ( err ) => {
0 commit comments