6767 tag : ${{ steps.version.outputs.tag }}
6868 repo : ${{ steps.version.outputs.repo }}
6969
70- build-cli :
70+ build-cli-linux-win :
7171 needs : version
7272 runs-on : blacksmith-4vcpu-ubuntu-2404
7373 if : github.repository == 'anomalyco/opencode'
@@ -94,17 +94,111 @@ jobs:
9494 OPENCODE_RELEASE : ${{ needs.version.outputs.release }}
9595 GH_REPO : ${{ needs.version.outputs.repo }}
9696 GH_TOKEN : ${{ steps.committer.outputs.token }}
97+ OPENCODE_BUILD_OS : linux,win32
98+ OPENCODE_SKIP_RELEASE_UPLOAD : " 1"
99+
100+ - uses : actions/upload-artifact@v4
101+ with :
102+ name : opencode-cli-linux-win
103+ path : packages/opencode/dist
104+
105+ build-cli-darwin :
106+ needs : version
107+ runs-on : macos-latest
108+ if : github.repository == 'anomalyco/opencode'
109+ steps :
110+ - uses : actions/checkout@v3
111+ with :
112+ fetch-tags : true
113+
114+ - uses : ./.github/actions/setup-bun
115+
116+ - name : Setup git committer
117+ id : committer
118+ uses : ./.github/actions/setup-git-committer
119+ with :
120+ opencode-app-id : ${{ vars.OPENCODE_APP_ID }}
121+ opencode-app-secret : ${{ secrets.OPENCODE_APP_SECRET }}
122+
123+ - uses : apple-actions/import-codesign-certs@v2
124+ with :
125+ keychain : build
126+ p12-file-base64 : ${{ secrets.APPLE_CERTIFICATE }}
127+ p12-password : ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
128+
129+ - name : Resolve signing identity
130+ run : |
131+ CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Developer ID Application")
132+ CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}')
133+ if [ -z "$CERT_ID" ]; then
134+ echo "Developer ID Application identity not found"
135+ exit 1
136+ fi
137+ echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV
138+
139+ - name : Build
140+ id : build
141+ run : |
142+ ./packages/opencode/script/build.ts
143+ env :
144+ OPENCODE_VERSION : ${{ needs.version.outputs.version }}
145+ OPENCODE_RELEASE : ${{ needs.version.outputs.release }}
146+ GH_REPO : ${{ needs.version.outputs.repo }}
147+ GH_TOKEN : ${{ steps.committer.outputs.token }}
148+ APPLE_SIGNING_IDENTITY : ${{ env.CERT_ID }}
149+ OPENCODE_BUILD_OS : darwin
150+ OPENCODE_SKIP_RELEASE_UPLOAD : " 1"
151+
152+ - name : Verify darwin signatures
153+ run : |
154+ for file in packages/opencode/dist/opencode-darwin-*/bin/opencode; do
155+ codesign -vvv --verify "$file"
156+ done
157+
158+ - uses : actions/upload-artifact@v4
159+ with :
160+ name : opencode-cli-darwin
161+ path : packages/opencode/dist
162+
163+ build-cli-merge :
164+ needs :
165+ - version
166+ - build-cli-linux-win
167+ - build-cli-darwin
168+ runs-on : blacksmith-4vcpu-ubuntu-2404
169+ if : github.repository == 'anomalyco/opencode'
170+ steps :
171+ - uses : actions/checkout@v3
172+
173+ - uses : ./.github/actions/setup-bun
174+
175+ - name : Setup git committer
176+ id : committer
177+ uses : ./.github/actions/setup-git-committer
178+ with :
179+ opencode-app-id : ${{ vars.OPENCODE_APP_ID }}
180+ opencode-app-secret : ${{ secrets.OPENCODE_APP_SECRET }}
181+
182+ - uses : actions/download-artifact@v4
183+ with :
184+ pattern : opencode-cli-*
185+ path : packages/opencode/dist
186+ merge-multiple : true
187+
188+ - name : Upload CLI release assets
189+ if : needs.version.outputs.release
190+ run : gh release upload v${{ needs.version.outputs.version }} ./packages/opencode/dist/*.zip ./packages/opencode/dist/*.tar.gz --clobber --repo ${{ needs.version.outputs.repo }}
191+ env :
192+ GH_TOKEN : ${{ steps.committer.outputs.token }}
97193
98194 - uses : actions/upload-artifact@v4
99195 with :
100196 name : opencode-cli
101197 path : packages/opencode/dist
102- outputs :
103- version : ${{ needs.version.outputs.version }}
104198
105199 build-tauri :
106200 needs :
107- - build-cli
201+ - build-cli-merge
108202 - version
109203 continue-on-error : false
110204 strategy :
@@ -248,7 +342,7 @@ jobs:
248342
249343 build-electron :
250344 needs :
251- - build-cli
345+ - build-cli-merge
252346 - version
253347 continue-on-error : false
254348 strategy :
@@ -372,7 +466,7 @@ jobs:
372466 publish :
373467 needs :
374468 - version
375- - build-cli
469+ - build-cli-merge
376470 - build-tauri
377471 - build-electron
378472 runs-on : blacksmith-4vcpu-ubuntu-2404
0 commit comments