Przeglądaj źródła

wip: github actions

Frank 7 miesięcy temu
rodzic
commit
7ac0a2bc65

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

@@ -17,7 +17,7 @@ jobs:
           fetch-depth: 1
 
       - name: Run opencode
-        uses: sst/opencode/sdks/github@dev
+        uses: sst/opencode/sdks/github@github-v1
         env:
           ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
         with:

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

@@ -26,5 +26,4 @@ jobs:
         run: |
           git config --global user.email "[email protected]"
           git config --global user.name "opencode"
-          ./script/publish-github-action.ts
-        working-directory: ./packages/opencode
+          ./scripts/publish-github-action.ts

+ 0 - 8
packages/opencode/script/publish-github-action.ts

@@ -1,8 +0,0 @@
-#!/usr/bin/env bun
-
-import { $ } from "bun"
-
-await $`git tag -d github-v1`
-await $`git push origin :refs/tags/github-v1`
-await $`git tag -a github-v1 -m "Update github-v1 to latest"`
-await $`git push origin github-v1`

+ 16 - 0
scripts/publish-github-action.ts

@@ -0,0 +1,16 @@
+#!/usr/bin/env bun
+
+import { $ } from "bun"
+
+try {
+  await $`git tag -d github-v1`
+  await $`git push origin :refs/tags/github-v1`
+} catch (e) {
+  if (e instanceof Error && e.message.includes("not found")) {
+    console.log("tag not found, continuing...")
+  } else {
+    throw e
+  }
+}
+await $`git tag -a github-v1 -m "Update github-v1 to latest"`
+await $`git push origin github-v1`