|
| 1 | +name: Build Linux |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, develop ] |
| 6 | + pull_request: |
| 7 | + branches: [ main, develop ] |
| 8 | + workflow_dispatch: # Manual trigger |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-linux-x64: |
| 12 | + name: Build Linux (x64) |
| 13 | + runs-on: ubuntu-latest |
| 14 | + timeout-minutes: 120 |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Setup Node.js |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version-file: '.nvmrc' |
| 24 | + cache: 'npm' |
| 25 | + |
| 26 | + - name: Setup Python 3 |
| 27 | + uses: actions/setup-python@v6 |
| 28 | + with: |
| 29 | + python-version: '3.11' |
| 30 | + |
| 31 | + - name: Install tsx (TypeScript runner) |
| 32 | + run: npm install -g tsx |
| 33 | + |
| 34 | + - name: Setup GCC |
| 35 | + uses: egor-tensin/setup-gcc@v1 |
| 36 | + with: |
| 37 | + version: 10 |
| 38 | + platform: x64 |
| 39 | + |
| 40 | + - name: Install build dependencies |
| 41 | + run: | |
| 42 | + sudo apt-get update |
| 43 | + sudo apt-get install -y \ |
| 44 | + dpkg-dev \ |
| 45 | + fakeroot \ |
| 46 | + build-essential \ |
| 47 | + pkg-config \ |
| 48 | + libkrb5-dev |
| 49 | +
|
| 50 | + - name: Run preinstall script manually |
| 51 | + run: tsx build/npm/preinstall.ts |
| 52 | + |
| 53 | + - name: Install dependencies (skip scripts) |
| 54 | + env: |
| 55 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 56 | + run: npm install --ignore-scripts |
| 57 | + |
| 58 | + - name: Run postinstall script manually |
| 59 | + env: |
| 60 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + run: tsx build/npm/postinstall.ts |
| 62 | + |
| 63 | + - name: Install roopik-roo extension dependencies |
| 64 | + working-directory: extensions/roopik-roo |
| 65 | + run: | |
| 66 | + if ! npm install; then |
| 67 | + echo "Normal install failed, trying with --legacy-peer-deps..." |
| 68 | + npm install --legacy-peer-deps |
| 69 | + node ../../.github/scripts/install-all-peer-deps.js || true |
| 70 | + fi |
| 71 | +
|
| 72 | + - name: Install @roo-code/types dependencies |
| 73 | + working-directory: extensions/roopik-roo/packages/types |
| 74 | + run: npm install |
| 75 | + |
| 76 | + - name: Build @roo-code/types package |
| 77 | + working-directory: extensions/roopik-roo/packages/types |
| 78 | + run: npm run build |
| 79 | + |
| 80 | + - name: Install @roo-code/build dependencies |
| 81 | + working-directory: extensions/roopik-roo/packages/build |
| 82 | + run: npm install |
| 83 | + |
| 84 | + - name: Build @roo-code/build package |
| 85 | + working-directory: extensions/roopik-roo/packages/build |
| 86 | + run: npm run build |
| 87 | + |
| 88 | + - name: Create .env file for roopik-roo |
| 89 | + working-directory: extensions/roopik-roo |
| 90 | + env: |
| 91 | + ROO_CODE_API_URL: ${{ secrets.ROO_CODE_API_URL || 'https://app.roocode.com' }} |
| 92 | + ROO_CODE_PROVIDER_URL: ${{ secrets.ROO_CODE_PROVIDER_URL || 'https://app.roocode.com/proxy/v1' }} |
| 93 | + POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY || '' }} |
| 94 | + run: | |
| 95 | + cat > .env << EOF |
| 96 | + ROO_CODE_API_URL=${ROO_CODE_API_URL} |
| 97 | + ROO_CODE_PROVIDER_URL=${ROO_CODE_PROVIDER_URL} |
| 98 | + POSTHOG_API_KEY=${POSTHOG_API_KEY} |
| 99 | + EOF |
| 100 | +
|
| 101 | + - name: Build roopik-roo extension |
| 102 | + working-directory: extensions/roopik-roo |
| 103 | + run: npm run build |
| 104 | + |
| 105 | + - name: Install roopik extension dependencies (skip postinstall) |
| 106 | + working-directory: extensions/roopik |
| 107 | + run: npm install --ignore-scripts |
| 108 | + |
| 109 | + - name: Install roopik webview dependencies |
| 110 | + working-directory: extensions/roopik/webview |
| 111 | + run: npm install |
| 112 | + |
| 113 | + - name: Build roopik extension |
| 114 | + working-directory: extensions/roopik |
| 115 | + run: npm run build |
| 116 | + |
| 117 | + - name: Compile VS Code |
| 118 | + run: npm run compile-build |
| 119 | + |
| 120 | + - name: Build Linux application (x64) |
| 121 | + run: npm run gulp vscode-linux-x64 |
| 122 | + |
| 123 | + - name: Build DEB package (custom) |
| 124 | + env: |
| 125 | + APP_NAME: roopik |
| 126 | + VSCODE_ARCH: x64 |
| 127 | + run: bash .github/build/linux/package_roopik_deb.sh |
| 128 | + continue-on-error: true |
| 129 | + |
| 130 | + - name: Copy Linux build to workspace |
| 131 | + run: | |
| 132 | + mkdir -p .artifacts/installer |
| 133 | +
|
| 134 | + # Copy and rename portable version |
| 135 | + cp -r ../VSCode-linux-x64 ./Roopik-Portable-linux-x64 |
| 136 | +
|
| 137 | + # Copy DEB file if it exists |
| 138 | + DEB_FILE=$(find .build/linux/deb -name "roopik_*.deb" -type f | head -n 1) |
| 139 | + if [ -n "$DEB_FILE" ]; then |
| 140 | + echo "Found DEB file: $DEB_FILE" |
| 141 | + cp "$DEB_FILE" .artifacts/installer/ |
| 142 | + else |
| 143 | + echo "Warning: DEB file not found, skipping installer artifact" |
| 144 | + fi |
| 145 | +
|
| 146 | + # List what we're uploading |
| 147 | + echo "Artifact contents:" |
| 148 | + ls -lah Roopik-Portable-linux-x64/ |
| 149 | + ls -lah .artifacts/ |
| 150 | +
|
| 151 | + - name: Upload Linux artifacts (x64) |
| 152 | + uses: actions/upload-artifact@v4 |
| 153 | + with: |
| 154 | + name: roopik-linux-x64 |
| 155 | + path: | |
| 156 | + Roopik-Portable-linux-x64/ |
| 157 | + .artifacts/installer/ |
| 158 | + retention-days: 30 |
0 commit comments