@@ -21,6 +21,9 @@ async function main() {
21
21
validatePackages ( publicPackages ) ;
22
22
await publishPackages ( publicPackages , version ) ;
23
23
await publishRustClient ( version ) ;
24
+
25
+ // Create GitHub release
26
+ await createGitHubRelease ( version ) ;
24
27
}
25
28
26
29
async function runTypeCheck ( ) {
@@ -210,7 +213,48 @@ async function publishPackages(publicPackages: any[], version: string) {
210
213
}
211
214
212
215
console . log ( chalk . green ( `✅ Published all packages at version ${ version } ` ) ) ;
213
- console . log ( chalk . yellow ( "! Make sure to merge Release Please" ) ) ;
216
+ }
217
+
218
+ async function createGitHubRelease ( version : string ) {
219
+ console . log ( chalk . blue ( "Creating GitHub release..." ) ) ;
220
+
221
+ try {
222
+ // Get the current tag name (should be the tag created during the release process)
223
+ const { stdout : currentTag } = await $ `git describe --tags --exact-match` ;
224
+ const tagName = currentTag . trim ( ) ;
225
+
226
+ console . log ( chalk . blue ( `Looking for existing release for ${ version } ` ) ) ;
227
+
228
+ // Check if a release with this version name already exists
229
+ const { stdout : releaseJson } = await $ `gh release list --json name,tagName` ;
230
+ const releases = JSON . parse ( releaseJson ) ;
231
+ const existingRelease = releases . find ( ( r : any ) => r . name === version ) ;
232
+
233
+ if ( existingRelease ) {
234
+ console . log ( chalk . blue ( `Updating release ${ version } to point to new tag ${ tagName } ` ) ) ;
235
+ await $ `gh release edit ${ existingRelease . tagName } --tag ${ tagName } ` ;
236
+ } else {
237
+ console . log ( chalk . blue ( `Creating new release ${ version } pointing to tag ${ tagName } ` ) ) ;
238
+ await $ `gh release create ${ tagName } --title ${ version } --draft --generate-notes` ;
239
+
240
+ // Check if this is a pre-release (contains -rc. or similar)
241
+ if ( version . includes ( "-" ) ) {
242
+ await $ `gh release edit ${ tagName } --prerelease` ;
243
+ }
244
+ }
245
+
246
+ // Check if we have a dist directory with artifacts to upload
247
+ const { exitCode } = await $ ( { nothrow : true } ) `test -d dist` ;
248
+ if ( exitCode === 0 ) {
249
+ console . log ( chalk . blue ( `Uploading artifacts for tag ${ tagName } ` ) ) ;
250
+ await $ `gh release upload ${ tagName } dist/* --clobber` ;
251
+ }
252
+
253
+ console . log ( chalk . green ( "✅ GitHub release created/updated" ) ) ;
254
+ } catch ( err ) {
255
+ console . error ( chalk . red ( "❌ Failed to create GitHub release" ) , err ) ;
256
+ console . warn ( chalk . yellow ( "! You may need to create the release manually" ) ) ;
257
+ }
214
258
}
215
259
216
260
async function publishPackage ( pkg : any , version : string ) {
0 commit comments