-
Notifications
You must be signed in to change notification settings - Fork 8
279 lines (234 loc) · 10.1 KB
/
Copy pathbuild-linux.yml
File metadata and controls
279 lines (234 loc) · 10.1 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
name: Build Linux
on:
push:
branches: [ main, develop ]
tags: [ 'v*' ]
pull_request:
branches: [ main, develop ]
workflow_dispatch: # Manual trigger
concurrency:
group: build-linux-${{ github.ref }}
cancel-in-progress: false
env:
VSCODE_QUALITY: stable
jobs:
build-linux-x64:
name: Build Linux (x64)
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
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: Setup GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 10
platform: x64
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
dpkg-dev \
fakeroot \
build-essential \
pkg-config \
libkrb5-dev
- 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: Install native module build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libx11-dev \
libxkbfile-dev \
libkrb5-dev \
libsecret-1-dev
- name: Rebuild native modules
run: npm rebuild
- name: Generate DOM whitelist from MDN
run: node build/scripts/generateDOMWhitelist.mjs
- name: Install roopik-zoo extension dependencies
working-directory: extensions/roopik-zoo
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-zoo/packages/types
run: npm install
- name: Build @roo-code/types package
working-directory: extensions/roopik-zoo/packages/types
run: npm run build
- name: Install @roo-code/build dependencies
working-directory: extensions/roopik-zoo/packages/build
run: npm install
- name: Build @roo-code/build package
working-directory: extensions/roopik-zoo/packages/build
run: npm run build
- name: Create .env file for roopik-zoo
working-directory: extensions/roopik-zoo
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-zoo extension
working-directory: extensions/roopik-zoo
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 (Linux)
working-directory: tools/roopik/mcp-stdio-server
run: |
npm ci
mkdir -p ../../../resources/mcp-binaries
npm run build:binary:linux
- name: Build Linux application (x64)
env:
NODE_OPTIONS: --max-old-space-size=4096
BUILD_SOURCEVERSION: ${{ github.sha }}
run: npm run gulp vscode-linux-x64
- name: Build DEB package (custom)
env:
APP_NAME: roopik
VSCODE_ARCH: x64
BUILD_SOURCEVERSION: ${{ github.sha }}
run: bash .github/build/linux/package_roopik_deb.sh
continue-on-error: true
- name: Prepare Linux release artifact
run: |
mkdir -p .artifacts/installer
mkdir -p .artifacts/public
mkdir -p .artifacts/archive
# Copy and rename portable version
cp -r ../VSCode-linux-x64 ./Roopik-Portable-linux-x64
# Copy DEB file if it exists
DEB_FILE=$(find .build/linux/deb -name "roopik_*.deb" -type f | head -n 1)
if [ -n "$DEB_FILE" ]; then
echo "Found DEB file: $DEB_FILE"
cp "$DEB_FILE" .artifacts/installer/
cp "$DEB_FILE" .artifacts/public/roopik-linux-latest.deb
else
echo "Warning: DEB file not found, skipping installer artifact"
fi
# Distro-agnostic tar.gz archive — for AUR (roopik-bin) and any
# non-Debian Linux user. Uploaded as a SEPARATE GitHub artifact.
TARBALL=".artifacts/archive/roopik-linux-x64-latest.tar.gz"
tar -czf "$TARBALL" -C .. VSCode-linux-x64
sha256sum "$TARBALL" | awk '{print $1}' > "${TARBALL}.sha256"
# List what we're uploading
echo "Artifact contents:"
ls -lah Roopik-Portable-linux-x64/
ls -lah .artifacts/
ls -lah .artifacts/archive/
- name: Upload Linux artifacts (x64)
uses: actions/upload-artifact@v6
with:
name: roopik-linux-release
path: |
.artifacts/public/
Roopik-Portable-linux-x64/
retention-days: 10
- name: Upload Linux archive artifact (x64)
uses: actions/upload-artifact@v6
with:
name: roopik-linux-archive
path: .artifacts/archive/
retention-days: 10
- name: Install AWS CLI
continue-on-error: true
run: |
python3 -m pip install --user awscli
- name: Upload Linux 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: |
set -euo pipefail
endpoint="https://${R2_ACCOUNT_ID}.r2.cloudflarestorage.com"
deb_file="$(find .artifacts/installer -name 'roopik_*.deb' -type f | head -n 1)"
if [ -z "$deb_file" ]; then
echo "DEB file not found in .artifacts/installer"
exit 1
fi
export AWS_ACCESS_KEY_ID="$R2_ACCESS_KEY_ID"
export AWS_SECRET_ACCESS_KEY="$R2_SECRET_ACCESS_KEY"
export AWS_EC2_METADATA_DISABLED=true
# Per-format folders so each install type has its own update channel.
# A .deb install must only ever see .deb updates; an arch/tarball
# install must only see tarball updates. They cannot share a manifest.
aws s3 cp "$deb_file" "s3://${R2_BUCKET}/linux/deb/roopik-linux-latest.deb" --endpoint-url "$endpoint" --no-progress
# Back-compat: keep the legacy path so already-installed clients
# pointing at linux/roopik-linux-latest.deb keep updating.
aws s3 cp "$deb_file" "s3://${R2_BUCKET}/linux/roopik-linux-latest.deb" --endpoint-url "$endpoint" --no-progress
tarball=".artifacts/archive/roopik-linux-x64-latest.tar.gz"
tarball_sha_file="${tarball}.sha256"
tarball_present=0
if [ -f "$tarball" ]; then
tarball_present=1
aws s3 cp "$tarball" "s3://${R2_BUCKET}/linux/archive/roopik-linux-x64-latest.tar.gz" --endpoint-url "$endpoint" --no-progress
aws s3 cp "$tarball_sha_file" "s3://${R2_BUCKET}/linux/archive/roopik-linux-x64-latest.tar.gz.sha256" --endpoint-url "$endpoint" --no-progress
else
echo "Tarball not found at $tarball, skipping tarball upload."
fi
if [ -z "${R2_PUBLIC_BASE_URL:-}" ]; then
echo "R2_PUBLIC_BASE_URL not set, skipping update manifest upload."
exit 0
fi
version="$(node -p "require('./package.json').version")"
commit="${{ github.sha }}"
deb_hash="$(sha256sum "$deb_file" | awk '{print tolower($1)}')"
pub_date="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
base="${R2_PUBLIC_BASE_URL%/}"
# --- DEB channel manifest ---
deb_url="${base}/linux/deb/roopik-linux-latest.deb"
deb_json="$(printf '{"version":"%s","productVersion":"%s","url":"%s","sha256hash":"%s","pub_date":"%s"}' "$commit" "$version" "$deb_url" "$deb_hash" "$pub_date")"
printf '%s' "$deb_json" > latest-deb.json
aws s3 cp latest-deb.json "s3://${R2_BUCKET}/linux/deb/stable/latest.json" --endpoint-url "$endpoint" --no-progress
# Back-compat: legacy manifest path used by older installs.
aws s3 cp latest-deb.json "s3://${R2_BUCKET}/linux/stable/latest.json" --endpoint-url "$endpoint" --no-progress
# --- Archive (tar.gz) channel manifest ---
if [ "$tarball_present" = "1" ]; then
tarball_url="${base}/linux/archive/roopik-linux-x64-latest.tar.gz"
tarball_hash="$(sha256sum "$tarball" | awk '{print tolower($1)}')"
archive_json="$(printf '{"version":"%s","productVersion":"%s","url":"%s","sha256hash":"%s","pub_date":"%s"}' "$commit" "$version" "$tarball_url" "$tarball_hash" "$pub_date")"
printf '%s' "$archive_json" > latest-archive.json
aws s3 cp latest-archive.json "s3://${R2_BUCKET}/linux/archive/stable/latest.json" --endpoint-url "$endpoint" --no-progress
fi