-
Notifications
You must be signed in to change notification settings - Fork 8
232 lines (194 loc) · 7.63 KB
/
Copy pathbuild-linux.yml
File metadata and controls
232 lines (194 loc) · 7.63 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
name: Build Linux
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch: # Manual trigger
concurrency:
group: build-linux-${{ github.ref }}
cancel-in-progress: false
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@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: 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-roo extension dependencies
working-directory: extensions/roopik-roo
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
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 (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
# 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
# List what we're uploading
echo "Artifact contents:"
ls -lah Roopik-Portable-linux-x64/
ls -lah .artifacts/
- name: Upload Linux artifacts (x64)
uses: actions/upload-artifact@v4
with:
name: roopik-linux-release
path: |
.artifacts/public/
Roopik-Portable-linux-x64/
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"
prefix="linux/"
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
aws s3 cp "$deb_file" "s3://${R2_BUCKET}/${prefix}roopik-linux-latest.deb" --endpoint-url "$endpoint" --no-progress
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 }}"
hash="$(sha256sum "$deb_file" | awk '{print tolower($1)}')"
pub_date="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
base="${R2_PUBLIC_BASE_URL%/}"
url="${base}/linux/roopik-linux-latest.deb"
# CRITICAL: 'version' must be the commit hash for update comparison
# 'productVersion' is the human-readable version (e.g., "1.109.0")
json="$(printf '{"version":"%s","productVersion":"%s","url":"%s","sha256hash":"%s","pub_date":"%s"}' "$commit" "$version" "$url" "$hash" "$pub_date")"
printf '%s' "$json" > latest.json
aws s3 cp latest.json "s3://${R2_BUCKET}/linux/stable/latest.json" --endpoint-url "$endpoint" --no-progress