-
Notifications
You must be signed in to change notification settings - Fork 8
214 lines (179 loc) · 7.49 KB
/
Copy pathbuild-windows.yml
File metadata and controls
214 lines (179 loc) · 7.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: Build Windows
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch: # Manual trigger
concurrency:
group: build-windows-${{ github.ref }}
cancel-in-progress: false
jobs:
build-windows:
name: Build Windows (x64)
runs-on: windows-latest
timeout-minutes: 120
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Setup Python 3
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install tsx (TypeScript runner)
run: npm install -g tsx
- name: Run preinstall script manually
run: tsx build/npm/preinstall.ts
- name: Install dependencies (skip scripts)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm install --ignore-scripts
- name: Run postinstall script manually
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: tsx build/npm/postinstall.ts
- name: Rebuild native modules
run: npm rebuild
- name: Generate DOM whitelist from MDN
run: node build/scripts/generateDOMWhitelist.mjs
- name: Install roopik-roo extension dependencies
working-directory: extensions/roopik-roo
shell: bash
run: |
if ! npm install; then
echo "Normal install failed, trying with --legacy-peer-deps..."
npm install --legacy-peer-deps
node ../../.github/scripts/install-all-peer-deps.js || true
fi
- name: Install @roo-code/types dependencies
working-directory: extensions/roopik-roo/packages/types
run: npm install
- name: Build @roo-code/types package
working-directory: extensions/roopik-roo/packages/types
run: npm run build
- name: Install @roo-code/build dependencies
working-directory: extensions/roopik-roo/packages/build
run: npm install
- name: Build @roo-code/build package
working-directory: extensions/roopik-roo/packages/build
run: npm run build
- name: Create .env file for roopik-roo
working-directory: extensions/roopik-roo
shell: bash
env:
ROO_CODE_API_URL: ${{ secrets.ROO_CODE_API_URL || 'https://app.roocode.com' }}
ROO_CODE_PROVIDER_URL: ${{ secrets.ROO_CODE_PROVIDER_URL || 'https://app.roocode.com/proxy/v1' }}
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY || '' }}
run: |
cat > .env << EOF
ROO_CODE_API_URL=${ROO_CODE_API_URL}
ROO_CODE_PROVIDER_URL=${ROO_CODE_PROVIDER_URL}
POSTHOG_API_KEY=${POSTHOG_API_KEY}
EOF
- name: Build roopik-roo extension
working-directory: extensions/roopik-roo
run: npm run build
- name: Install roopik extension dependencies (skip postinstall)
working-directory: extensions/roopik
run: npm install --ignore-scripts
- name: Install roopik webview dependencies
working-directory: extensions/roopik/webview
run: npm install
- name: Build roopik extension
working-directory: extensions/roopik
run: npm run build
- name: Build MCP STDIO binary (Windows)
working-directory: tools/roopik/mcp-stdio-server
shell: bash
run: |
npm ci
mkdir -p ../../../resources/mcp-binaries
npm run build:binary:win
- name: Clean non-Windows prebuilds from node_modules
shell: bash
run: |
# Remove macOS and Linux prebuilds to prevent rcedit.exe errors
find node_modules -type d -name "prebuilds" -exec sh -c '
for dir in "$1"/*; do
case "$(basename "$dir")" in
darwin-*|linux-*) rm -rf "$dir" ;;
esac
done
' sh {} \;
- name: Build Windows application
env:
BUILD_SOURCEVERSION: ${{ github.sha }}
run: npm run gulp vscode-win32-x64
- name: Prepare Inno Setup tools
env:
BUILD_SOURCEVERSION: ${{ github.sha }}
run: npm run gulp vscode-win32-x64-inno-updater
- name: Build Windows installer (User)
env:
BUILD_SOURCEVERSION: ${{ github.sha }}
run: npm run gulp vscode-win32-x64-user-setup
# System installer commented out - use User installer for most cases
# Uncomment if you need system-wide installation for all users
# - name: Build Windows installer (System)
# run: npm run gulp vscode-win32-x64-system-setup
- name: Prepare Windows release artifact
shell: powershell
run: |
Copy-Item -Recurse -Force ..\VSCode-win32-x64 .\Roopik-Portable-win32-x64
New-Item -ItemType Directory -Force -Path .artifacts\public | Out-Null
$installer = Get-ChildItem -Path .build\win32-x64\user-setup -Filter RoopikSetup.exe | Select-Object -First 1
if (-not $installer) { throw "RoopikSetup.exe not found in .build\win32-x64\user-setup" }
Copy-Item $installer.FullName .artifacts\public\roopik-windows-latest.exe -Force
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: roopik-windows-release
path: |
.artifacts/public/
Roopik-Portable-win32-x64/
retention-days: 10
- name: Install AWS CLI
continue-on-error: true
run: choco install awscli -y
- name: Upload Windows installer to R2
continue-on-error: true
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
R2_BUCKET: ${{ secrets.R2_BUCKET }}
R2_PUBLIC_BASE_URL: ${{ secrets.R2_PUBLIC_BASE_URL }}
run: |
$endpoint = "https://$env:R2_ACCOUNT_ID.r2.cloudflarestorage.com"
$prefix = "windows/"
$installer = Get-ChildItem -Path .build\win32-x64\user-setup -Filter RoopikSetup.exe | Select-Object -First 1
if (-not $installer) { throw "RoopikSetup.exe not found in .build\\win32-x64\\user-setup" }
$env:AWS_ACCESS_KEY_ID = $env:R2_ACCESS_KEY_ID
$env:AWS_SECRET_ACCESS_KEY = $env:R2_SECRET_ACCESS_KEY
$env:AWS_EC2_METADATA_DISABLED = "true"
aws s3 cp $installer.FullName "s3://$env:R2_BUCKET/${prefix}roopik-windows-latest.exe" --endpoint-url $endpoint --no-progress
if (-not $env:R2_PUBLIC_BASE_URL) {
Write-Host "R2_PUBLIC_BASE_URL not set, skipping update manifest upload."
exit 0
}
$version = node -p "require('./package.json').version"
$commit = "${{ github.sha }}"
$hash = (Get-FileHash -Algorithm SHA256 $installer.FullName).Hash.ToLower()
$pubDate = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
$base = $env:R2_PUBLIC_BASE_URL.TrimEnd('/')
$url = "$base/windows/roopik-windows-latest.exe"
$json = @{
version = $commit
productVersion = $version
url = $url
sha256hash = $hash
pub_date = $pubDate
} | ConvertTo-Json -Compress
$tmp = Join-Path $env:TEMP "latest.json"
$json | Out-File -Encoding utf8 $tmp
aws s3 cp $tmp "s3://$env:R2_BUCKET/windows/stable/latest.json" --endpoint-url $endpoint --no-progress