@@ -2,138 +2,46 @@ name: desktop-arm64-portable
22
33on :
44 workflow_dispatch :
5- inputs :
6- version :
7- description : " Version override (optional)"
8- required : false
9- type : string
10- channel :
11- description : " Build channel"
12- required : false
13- type : choice
14- default : " prod"
15- options :
16- - dev
17- - beta
18- - prod
195
20- concurrency : ${{ github.workflow }}-${{ github.ref }}-${{ inputs.version }}
6+ concurrency : ${{ github.workflow }}-${{ github.ref }}
217
228permissions :
239 contents : write
24- id-token : write
2510
2611jobs :
27- build-windows-arm64-portable :
12+ build :
2813 runs-on : windows-2025
2914 steps :
3015 - uses : actions/checkout@v4
3116
3217 - name : Setup Bun
3318 uses : ./.github/actions/setup-bun
34- with :
35- install-flags : --os=win --cpu=arm64
36-
37- - name : Setup Node.js
38- uses : actions/setup-node@v4
39- with :
40- node-version : " 24"
41-
42- - name : Determine version
43- id : version
44- shell : pwsh
45- run : |
46- if ("${{ inputs.version }}" -ne "") {
47- $version = "${{ inputs.version }}"
48- } else {
49- $version = (git describe --tags --abbrev=0 2>$null) -replace "^v", ""
50- if (-not $version) {
51- $version = "0.0.0-dev"
52- }
53- }
54- Write-Host "Version: $version"
55- Write-Host "version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8
5619
57- - name : Install all dependencies
20+ - name : Install dependencies
5821 run : bun install
5922
6023 - name : Prepare desktop package
6124 working-directory : packages/desktop
62- shell : pwsh
6325 run : |
64- $env:OPENCODE_VERSION = "${{ steps.version.outputs.version }}"
65- $env:OPENCODE_CHANNEL = "${{ inputs.channel }}"
6626 $env:RUST_TARGET = "aarch64-pc-windows-msvc"
6727 bun ./scripts/prepare.ts
6828
69- - name : Install dependencies
29+ - name : Install desktop deps
7030 working-directory : packages/desktop
7131 run : bun install
7232
73- - name : Build desktop application
33+ - name : Build desktop
7434 working-directory : packages/desktop
7535 run : bun run build
76- env :
77- OPENCODE_CHANNEL : ${{ inputs.channel }}
78- SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
79- SENTRY_ORG : ${{ vars.SENTRY_ORG }}
80- SENTRY_PROJECT : ${{ vars.WEB_SENTRY_PROJECT }}
81- VITE_SENTRY_ENVIRONMENT : ${{ inputs.channel }}
8236
83- - name : Build portable executable
37+ - name : Package portable EXE
8438 working-directory : packages/desktop
8539 run : npx electron-builder --win --arm64 --publish never --config electron-builder.config.ts
8640 timeout-minutes : 60
87- env :
88- OPENCODE_CHANNEL : ${{ inputs.channel }}
89-
90- - name : Find portable EXE
91- shell : pwsh
92- run : |
93- $exe = Get-ChildItem -Path "packages/desktop/dist" -Filter "*portable*.exe" -Recurse | Select-Object -First 1
94- if ($exe) {
95- Write-Host "Found portable EXE: $($exe.FullName)"
96- Write-Host "exe=$($exe.Name)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8
97- } else {
98- Write-Host "No portable EXE found, listing dist contents:"
99- Get-ChildItem -Path "packages/desktop/dist" | ForEach-Object { Write-Host $_.Name }
100- Write-Host "Searching for any exe files..."
101- Get-ChildItem -Path "packages/desktop/dist" -Filter "*.exe" -Recurse | ForEach-Object { Write-Host $_.FullName }
102- }
103-
104- - name : Sign portable EXE
105- if : vars.AZURE_TRUSTED_SIGNING_ENDPOINT != ''
106- working-directory : packages/desktop
107- shell : pwsh
108- run : |
109- $exePath = "${{ github.workspace }}\packages\desktop\dist\${{ steps.find-exe.outputs.exe }}"
110- if (Test-Path $exePath) {
111- az trusted-signing sign --endpoint ${{ vars.AZURE_TRUSTED_SIGNING_ENDPOINT }} --account-name ${{ vars.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }} --certificate-profile-name ${{ vars.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }} --file $exePath
112- }
113-
114- - name : Verify signature
115- if : vars.AZURE_TRUSTED_SIGNING_ENDPOINT != ''
116- shell : pwsh
117- run : |
118- $exePath = "${{ github.workspace }}\packages\desktop\dist\${{ steps.find-exe.outputs.exe }}"
119- $sig = Get-AuthenticodeSignature $exePath
120- if ($sig.Status -ne "Valid") {
121- throw "Invalid signature: $($sig.Status)"
122- }
123- Write-Host "Signature verified successfully"
124-
125- - name : Upload portable EXE as artifact
126- uses : actions/upload-artifact@v4
127- with :
128- name : opencode-desktop-windows-arm64-portable
129- path : |
130- packages/desktop/dist/*portable*.exe
131- retention-days : 30
13241
133- - name : Upload all build artifacts
42+ - name : Upload portable EXE
13443 uses : actions/upload-artifact@v4
13544 with :
136- name : opencode-desktop-build-arm64
137- path : |
138- packages/desktop/dist/*
45+ name : opencode-desktop-win-arm64-portable
46+ path : packages/desktop/dist/*portable*.exe
13947 retention-days : 7
0 commit comments