@@ -37,15 +37,22 @@ jobs:
3737 steps :
3838 - uses : actions/checkout@v3
3939 with :
40- fetch-depth : 1
40+ fetch-depth : 0
41+
4142 - uses : ./.github/actions/setup-bun
43+
44+ - name : Install OpenCode
45+ if : inputs.bump || inputs.version
46+ run : bun i -g opencode-ai
47+
4248 - id : version
4349 run : |
4450 ./script/version.ts
4551 env :
4652 GH_TOKEN : ${{ github.token }}
4753 OPENCODE_BUMP : ${{ inputs.bump }}
4854 OPENCODE_VERSION : ${{ inputs.version }}
55+ OPENCODE_API_KEY : ${{ secrets.OPENCODE_API_KEY }}
4956 outputs :
5057 version : ${{ steps.version.outputs.version }}
5158 release : ${{ steps.version.outputs.release }}
5865 steps :
5966 - uses : actions/checkout@v3
6067 with :
61- fetch-depth : 1
6268 fetch-tags : true
6369
6470 - uses : ./.github/actions/setup-bun
@@ -103,7 +109,6 @@ jobs:
103109 steps :
104110 - uses : actions/checkout@v3
105111 with :
106- fetch-depth : 1
107112 fetch-tags : true
108113
109114 - uses : apple-actions/import-codesign-certs@v2
@@ -128,6 +133,15 @@ jobs:
128133
129134 - uses : ./.github/actions/setup-bun
130135
136+ - name : Cache apt packages
137+ if : contains(matrix.settings.host, 'ubuntu')
138+ uses : actions/cache@v4
139+ with :
140+ path : /var/cache/apt/archives
141+ key : ${{ runner.os }}-${{ matrix.settings.target }}-apt-${{ hashFiles('.github/workflows/publish.yml') }}
142+ restore-keys : |
143+ ${{ runner.os }}-${{ matrix.settings.target }}-apt-
144+
131145 - name : install dependencies (ubuntu only)
132146 if : contains(matrix.settings.host, 'ubuntu')
133147 run : |
@@ -149,8 +163,8 @@ jobs:
149163 cd packages/desktop
150164 bun ./scripts/prepare.ts
151165 env :
152- OPENCODE_VERSION : ${{ needs.publish .outputs.version }}
153- GITHUB_TOKEN : ${{ secrets.SST_GITHUB_TOKEN }}
166+ OPENCODE_VERSION : ${{ needs.version .outputs.version }}
167+ GITHUB_TOKEN : ${{ steps.committer.outputs.token }}
154168 RUST_TARGET : ${{ matrix.settings.target }}
155169 GH_TOKEN : ${{ github.token }}
156170 GITHUB_RUN_ID : ${{ github.run_id }}
@@ -196,12 +210,8 @@ jobs:
196210 runs-on : blacksmith-4vcpu-ubuntu-2404
197211 steps :
198212 - uses : actions/checkout@v3
199- with :
200- fetch-depth : 1
201213
202- - name : Install OpenCode
203- if : inputs.bump || inputs.version
204- run : bun i -g opencode-ai
214+ - uses : ./.github/actions/setup-bun
205215
206216 - name : Login to GitHub Container Registry
207217 uses : docker/login-action@v3
@@ -221,19 +231,26 @@ jobs:
221231 node-version : " 24"
222232 registry-url : " https://registry.npmjs.org"
223233
224- - name : Setup Git Identity
225- run : |
226- git config --global user.email "[email protected] " 227- git config --global user.name "opencode"
228- git remote set-url origin https://x-access-token:${{ secrets.SST_GITHUB_TOKEN }}@github.com/${{ github.repository }}
229-
230- - uses : ./.github/actions/setup-bun
234+ - name : Setup git committer
235+ id : committer
236+ uses : ./.github/actions/setup-git-committer
237+ with :
238+ opencode-app-id : ${{ vars.OPENCODE_APP_ID }}
239+ opencode-app-secret : ${{ secrets.OPENCODE_APP_SECRET }}
231240
232241 - uses : actions/download-artifact@v4
233242 with :
234243 name : opencode-cli
235244 path : packages/opencode/dist
236245
246+ - name : Cache apt packages (AUR)
247+ uses : actions/cache@v4
248+ with :
249+ path : /var/cache/apt/archives
250+ key : ${{ runner.os }}-apt-aur-${{ hashFiles('.github/workflows/publish.yml') }}
251+ restore-keys : |
252+ ${{ runner.os }}-apt-aur-
253+
237254 - name : Setup SSH for AUR
238255 run : |
239256 sudo apt-get update
@@ -250,6 +267,5 @@ jobs:
250267 OPENCODE_VERSION : ${{ needs.version.outputs.version }}
251268 OPENCODE_RELEASE : ${{ needs.version.outputs.release }}
252269 AUR_KEY : ${{ secrets.AUR_KEY }}
253- GITHUB_TOKEN : ${{ secrets.SST_GITHUB_TOKEN }}
254- OPENCODE_API_KEY : ${{ secrets.OPENCODE_API_KEY }}
270+ GITHUB_TOKEN : ${{ steps.committer.outputs.token }}
255271 NPM_CONFIG_PROVENANCE : false
0 commit comments