Browse Source

ci: run prepare step for tauri build

Brendan Allan 2 months ago
parent
commit
11a92b24c2
2 changed files with 3 additions and 12 deletions
  1. 1 1
      .github/workflows/publish.yml
  2. 2 11
      packages/tauri/scripts/prepare.ts

+ 1 - 1
.github/workflows/publish.yml

@@ -155,7 +155,6 @@ jobs:
           shared-key: ${{ matrix.settings.target }}
 
       - name: Prepare
-        if: inputs.bump || inputs.version
         run: |
           cd packages/tauri
           bun ./scripts/prepare.ts
@@ -167,6 +166,7 @@ jobs:
           OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
           RUST_TARGET: ${{ matrix.settings.target }}
           GH_TOKEN: ${{ github.token }}
+          GITHUB_RUN_ID: ${{ github.run_id }}
 
       # Fixes AppImage build issues, can be removed when https://github.com/tauri-apps/tauri/pull/12491 is released
       - name: Install tauri-cli from portable appimage branch

+ 2 - 11
packages/tauri/scripts/prepare.ts

@@ -1,22 +1,13 @@
 #!/usr/bin/env bun
-
 import { $ } from "bun"
 
 import { copyBinaryToSidecarFolder, getCurrentSidecar } from "./utils"
-import { Script } from "@opencode-ai/script"
 
 const sidecarConfig = getCurrentSidecar()
 
 const dir = "src-tauri/target/opencode-binaries"
 
 await $`mkdir -p ${dir}`
-await $`gh run download ${Bun.env.GITHUB_RUN_ID} -n opencode-cli`
-await $`gh release download v${Script.version} --pattern ${sidecarConfig.ocBinary}.${sidecarConfig.assetExt} --repo sst/opencode --skip-existing --dir ${dir}`
-
-if (sidecarConfig.assetExt === "tar.gz") {
-  await $`tar -xvzf ${dir}/${sidecarConfig.ocBinary}.${sidecarConfig.assetExt} -C ${dir}`
-} else {
-  await $`unzip -o ${dir}/${sidecarConfig.ocBinary}.${sidecarConfig.assetExt} -d ${dir}`
-}
+await $`gh run download ${Bun.env.GITHUB_RUN_ID} -n opencode-cli`.cwd(dir);
 
-await copyBinaryToSidecarFolder(`${dir}/opencode${process.platform === "win32" ? ".exe" : ""}`)
+await copyBinaryToSidecarFolder(`${dir}/${sidecarConfig.ocBinary}/bin/opencode${process.platform === "win32" ? ".exe" : ""}`)