@@ -19,12 +19,10 @@ async function main() {
1919 const cleanVersion = version . replace ( / ^ v / , "" )
2020 console . log ( `📦 Syncing Zed extension for version ${ cleanVersion } ` )
2121
22- // Get the commit SHA for this version tag
2322 const commitSha = await $ `git rev-parse ${ version } ` . text ( )
2423 const sha = commitSha . trim ( )
2524 console . log ( `🔍 Found commit SHA: ${ sha } ` )
2625
27- // Read the extension.toml from this commit to verify version
2826 const extensionToml = await $ `git show ${ version } :packages/extensions/zed/extension.toml` . text ( )
2927 const parsed = Bun . TOML . parse ( extensionToml ) as { version : string }
3028 const extensionVersion = parsed . version
@@ -55,7 +53,6 @@ async function main() {
5553 console . log ( `🌿 Creating branch ${ branchName } ` )
5654 await $ `git checkout -b ${ branchName } `
5755
58- // Update the submodule for opencode extension
5956 const submodulePath = `extensions/${ EXTENSION_NAME } `
6057 console . log ( `📌 Updating submodule to commit ${ sha } ` )
6158 await $ `git submodule update --init ${ submodulePath } `
@@ -65,12 +62,10 @@ async function main() {
6562 process . chdir ( workDir )
6663 await $ `git add ${ submodulePath } `
6764
68- // Update extensions.toml
6965 console . log ( `📝 Updating extensions.toml` )
7066 const extensionsTomlPath = "extensions.toml"
7167 const extensionsToml = await Bun . file ( extensionsTomlPath ) . text ( )
7268
73- // Update version field for opencode extension
7469 const versionRegex = new RegExp ( `(\\[${ EXTENSION_NAME } \\]\\s+(?:.*\\s*)?)version = "[^"]+"` )
7570 const updatedToml = extensionsToml . replace ( versionRegex , `$1version = "${ cleanVersion } "` )
7671
@@ -81,7 +76,6 @@ async function main() {
8176 await Bun . write ( extensionsTomlPath , updatedToml )
8277 await $ `git add extensions.toml`
8378
84- // Commit changes
8579 const commitMessage = `Update ${ EXTENSION_NAME } to v${ cleanVersion }
8680
8781Release notes:
@@ -91,11 +85,9 @@ https://github.com/${OPENCODE_REPO}/releases/tag/v${cleanVersion}`
9185 await $ `git commit -m ${ commitMessage } `
9286 console . log ( `✅ Changes committed` )
9387
94- // Push to fork
9588 console . log ( `🚀 Pushing to fork...` )
9689 await $ `git push https://x-access-token:${ token } @github.com/${ FORK_REPO } .git ${ branchName } `
9790
98- // Create PR using gh CLI
9991 console . log ( `📬 Creating pull request...` )
10092 const prUrl =
10193 await $ `gh pr create --repo ${ UPSTREAM_REPO } --base main --head ${ FORK_REPO . split ( "/" ) [ 0 ] } :${ branchName } --title "Update ${ EXTENSION_NAME } to v${ cleanVersion } " --body "Release notes:\n\nhttps://github.com/${ OPENCODE_REPO } /releases/tag/v${ cleanVersion } "` . text ( )
0 commit comments