This repository was archived by the owner on Mar 10, 2026. It is now read-only.
fix(codex-v2): Fix desktop black screen — TerraRuntime API bundling, … #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Release CodeEX | ||
|
Check failure on line 1 in .github/workflows/build-release.yml
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version to build (e.g., 0.1.0)' | ||
| required: true | ||
| default: '0.1.0' | ||
| vscodium_version: | ||
| description: 'VSCodium version to base on (e.g., 1.107.18627)' | ||
| required: true | ||
| default: '1.107.18627' | ||
| create_release: | ||
| description: 'Create GitHub Release?' | ||
| required: true | ||
| type: boolean | ||
| default: true | ||
| env: | ||
| PRODUCT_NAME: "CodeEX - Ageixtic IDE" | ||
| APP_NAME: "CodeEX" | ||
| CODEX_VERSION: ${{ github.event.inputs.version || '0.1.0' }} | ||
| VSCODIUM_VERSION: ${{ github.event.inputs.vscodium_version || '1.107.18627' }} | ||
| jobs: | ||
| build-macos-arm64: | ||
| runs-on: macos-14 | ||
| steps: | ||
| - name: Checkout CodeEX | ||
| uses: actions/checkout@v4 | ||
| - name: Download VSCodium | ||
| run: | | ||
| curl -L -o vscodium.zip "https://github.com/VSCodium/vscodium/releases/download/${{ env.VSCODIUM_VERSION }}/VSCodium-darwin-arm64-${{ env.VSCODIUM_VERSION }}.zip" | ||
| unzip vscodium.zip -d VSCodium-darwin-arm64 | ||
| - name: Apply CodeEX Branding | ||
| run: | | ||
| APP_PATH="VSCodium-darwin-arm64/VSCodium.app" | ||
| # Rename app | ||
| mv "$APP_PATH" "VSCodium-darwin-arm64/${APP_NAME}.app" | ||
| APP_PATH="VSCodium-darwin-arm64/${APP_NAME}.app" | ||
| # Update Info.plist | ||
| /usr/libexec/PlistBuddy -c "Set :CFBundleName '${APP_NAME}'" "$APP_PATH/Contents/Info.plist" | ||
| /usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName '${PRODUCT_NAME}'" "$APP_PATH/Contents/Info.plist" | ||
| /usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier 'com.terratech.codex'" "$APP_PATH/Contents/Info.plist" | ||
| /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString '${{ env.CODEX_VERSION }}'" "$APP_PATH/Contents/Info.plist" | ||
| # Copy branding assets if they exist | ||
| if [ -d "branding/icons" ]; then | ||
| cp -r branding/icons/* "$APP_PATH/Contents/Resources/" 2>/dev/null || true | ||
| fi | ||
| - name: Install Extensions | ||
| run: | | ||
| APP_PATH="VSCodium-darwin-arm64/${APP_NAME}.app" | ||
| EXT_DIR="$APP_PATH/Contents/Resources/app/extensions" | ||
| # Install bundled extensions | ||
| for ext in extensions/*/; do | ||
| if [ -f "$ext/package.json" ]; then | ||
| ext_name=$(basename "$ext") | ||
| mkdir -p "$EXT_DIR/$ext_name" | ||
| cp -r "$ext"/* "$EXT_DIR/$ext_name/" | ||
| echo "Installed extension: $ext_name" | ||
| fi | ||
| done | ||
| - name: Import Code Signing Certificate | ||
| if: ${{ secrets.MACOS_CERTIFICATE != '' }} | ||
| env: | ||
| MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} | ||
| MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} | ||
| KEYCHAIN_PWD: ${{ secrets.KEYCHAIN_PWD }} | ||
| run: | | ||
| echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12 | ||
| security create-keychain -p "$KEYCHAIN_PWD" build.keychain | ||
| security default-keychain -s build.keychain | ||
| security unlock-keychain -p "$KEYCHAIN_PWD" build.keychain | ||
| security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign | ||
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PWD" build.keychain | ||
| - name: Sign Application | ||
| if: ${{ secrets.MACOS_CERTIFICATE != '' }} | ||
| env: | ||
| CERT_NAME: "Developer ID Application: TERRA TECH SYSTEMS (V2F8RR8GSR)" | ||
| run: | | ||
| APP_PATH="VSCodium-darwin-arm64/${APP_NAME}.app" | ||
| # Remove existing signatures | ||
| codesign --remove-signature "$APP_PATH" 2>/dev/null || true | ||
| # Sign all nested binaries | ||
| find "$APP_PATH" \( -name "*.node" -o -name "*.dylib" \) -type f | while read file; do | ||
| codesign --force --options runtime --timestamp --sign "$CERT_NAME" "$file" 2>/dev/null || true | ||
| done | ||
| # Sign executables | ||
| for binary in rg node codium-tunnel spawn-helper ShipIt; do | ||
| find "$APP_PATH" -name "$binary" -type f | while read file; do | ||
| codesign --force --options runtime --timestamp --sign "$CERT_NAME" "$file" 2>/dev/null || true | ||
| done | ||
| done | ||
| # Sign frameworks and helpers | ||
| find "$APP_PATH/Contents/Frameworks" -name "*.framework" -type d 2>/dev/null | while read fw; do | ||
| codesign --force --deep --options runtime --timestamp --sign "$CERT_NAME" "$fw" | ||
| done | ||
| find "$APP_PATH/Contents/Frameworks" -name "*.app" -type d 2>/dev/null | while read helper; do | ||
| codesign --force --deep --options runtime --timestamp --sign "$CERT_NAME" "$helper" | ||
| done | ||
| # Sign main app | ||
| codesign --force --deep --options runtime --timestamp --sign "$CERT_NAME" "$APP_PATH" | ||
| - name: Create DMG | ||
| run: | | ||
| DMG_TEMP="/tmp/codex-dmg" | ||
| mkdir -p "$DMG_TEMP" | ||
| cp -R "VSCodium-darwin-arm64/${APP_NAME}.app" "$DMG_TEMP/" | ||
| ln -s /Applications "$DMG_TEMP/Applications" | ||
| hdiutil create -volname "$PRODUCT_NAME" \ | ||
| -srcfolder "$DMG_TEMP" \ | ||
| -ov -format UDZO \ | ||
| "CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-arm64.dmg" | ||
| - name: Notarize DMG | ||
| if: ${{ secrets.APPLE_APP_PASSWORD != '' }} | ||
| env: | ||
| APPLE_ID: ${{ secrets.APPLE_ID }} | ||
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
| APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }} | ||
| run: | | ||
| xcrun notarytool submit "CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-arm64.dmg" \ | ||
| --apple-id "$APPLE_ID" \ | ||
| --team-id "$APPLE_TEAM_ID" \ | ||
| --password "$APPLE_APP_PASSWORD" \ | ||
| --wait | ||
| xcrun stapler staple "CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-arm64.dmg" | ||
| - name: Upload Artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: CodeEX-macos-arm64 | ||
| path: CodeEX-Ageixtic-IDE-*-arm64.dmg | ||
| build-macos-x64: | ||
| runs-on: macos-13 | ||
| steps: | ||
| - name: Checkout CodeEX | ||
| uses: actions/checkout@v4 | ||
| - name: Download VSCodium | ||
| run: | | ||
| curl -L -o vscodium.zip "https://github.com/VSCodium/vscodium/releases/download/${{ env.VSCODIUM_VERSION }}/VSCodium-darwin-x64-${{ env.VSCODIUM_VERSION }}.zip" | ||
| unzip vscodium.zip -d VSCodium-darwin-x64 | ||
| - name: Apply CodeEX Branding | ||
| run: | | ||
| APP_PATH="VSCodium-darwin-x64/VSCodium.app" | ||
| mv "$APP_PATH" "VSCodium-darwin-x64/${APP_NAME}.app" | ||
| APP_PATH="VSCodium-darwin-x64/${APP_NAME}.app" | ||
| /usr/libexec/PlistBuddy -c "Set :CFBundleName '${APP_NAME}'" "$APP_PATH/Contents/Info.plist" | ||
| /usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName '${PRODUCT_NAME}'" "$APP_PATH/Contents/Info.plist" | ||
| /usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier 'com.terratech.codex'" "$APP_PATH/Contents/Info.plist" | ||
| /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString '${{ env.CODEX_VERSION }}'" "$APP_PATH/Contents/Info.plist" | ||
| if [ -d "branding/icons" ]; then | ||
| cp -r branding/icons/* "$APP_PATH/Contents/Resources/" 2>/dev/null || true | ||
| fi | ||
| - name: Install Extensions | ||
| run: | | ||
| APP_PATH="VSCodium-darwin-x64/${APP_NAME}.app" | ||
| EXT_DIR="$APP_PATH/Contents/Resources/app/extensions" | ||
| for ext in extensions/*/; do | ||
| if [ -f "$ext/package.json" ]; then | ||
| ext_name=$(basename "$ext") | ||
| mkdir -p "$EXT_DIR/$ext_name" | ||
| cp -r "$ext"/* "$EXT_DIR/$ext_name/" | ||
| echo "Installed extension: $ext_name" | ||
| fi | ||
| done | ||
| - name: Import Code Signing Certificate | ||
| if: ${{ secrets.MACOS_CERTIFICATE != '' }} | ||
| env: | ||
| MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} | ||
| MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} | ||
| KEYCHAIN_PWD: ${{ secrets.KEYCHAIN_PWD }} | ||
| run: | | ||
| echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12 | ||
| security create-keychain -p "$KEYCHAIN_PWD" build.keychain | ||
| security default-keychain -s build.keychain | ||
| security unlock-keychain -p "$KEYCHAIN_PWD" build.keychain | ||
| security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign | ||
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PWD" build.keychain | ||
| - name: Sign Application | ||
| if: ${{ secrets.MACOS_CERTIFICATE != '' }} | ||
| env: | ||
| CERT_NAME: "Developer ID Application: TERRA TECH SYSTEMS (V2F8RR8GSR)" | ||
| run: | | ||
| APP_PATH="VSCodium-darwin-x64/${APP_NAME}.app" | ||
| codesign --remove-signature "$APP_PATH" 2>/dev/null || true | ||
| find "$APP_PATH" \( -name "*.node" -o -name "*.dylib" \) -type f | while read file; do | ||
| codesign --force --options runtime --timestamp --sign "$CERT_NAME" "$file" 2>/dev/null || true | ||
| done | ||
| for binary in rg node codium-tunnel spawn-helper ShipIt; do | ||
| find "$APP_PATH" -name "$binary" -type f | while read file; do | ||
| codesign --force --options runtime --timestamp --sign "$CERT_NAME" "$file" 2>/dev/null || true | ||
| done | ||
| done | ||
| find "$APP_PATH/Contents/Frameworks" -name "*.framework" -type d 2>/dev/null | while read fw; do | ||
| codesign --force --deep --options runtime --timestamp --sign "$CERT_NAME" "$fw" | ||
| done | ||
| find "$APP_PATH/Contents/Frameworks" -name "*.app" -type d 2>/dev/null | while read helper; do | ||
| codesign --force --deep --options runtime --timestamp --sign "$CERT_NAME" "$helper" | ||
| done | ||
| codesign --force --deep --options runtime --timestamp --sign "$CERT_NAME" "$APP_PATH" | ||
| - name: Create DMG | ||
| run: | | ||
| DMG_TEMP="/tmp/codex-dmg" | ||
| mkdir -p "$DMG_TEMP" | ||
| cp -R "VSCodium-darwin-x64/${APP_NAME}.app" "$DMG_TEMP/" | ||
| ln -s /Applications "$DMG_TEMP/Applications" | ||
| hdiutil create -volname "$PRODUCT_NAME" \ | ||
| -srcfolder "$DMG_TEMP" \ | ||
| -ov -format UDZO \ | ||
| "CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-x64.dmg" | ||
| - name: Notarize DMG | ||
| if: ${{ secrets.APPLE_APP_PASSWORD != '' }} | ||
| env: | ||
| APPLE_ID: ${{ secrets.APPLE_ID }} | ||
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
| APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }} | ||
| run: | | ||
| xcrun notarytool submit "CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-x64.dmg" \ | ||
| --apple-id "$APPLE_ID" \ | ||
| --team-id "$APPLE_TEAM_ID" \ | ||
| --password "$APPLE_APP_PASSWORD" \ | ||
| --wait | ||
| xcrun stapler staple "CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-x64.dmg" | ||
| - name: Upload Artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: CodeEX-macos-x64 | ||
| path: CodeEX-Ageixtic-IDE-*-x64.dmg | ||
| build-windows: | ||
| runs-on: windows-latest | ||
| steps: | ||
| - name: Checkout CodeEX | ||
| uses: actions/checkout@v4 | ||
| - name: Download VSCodium | ||
| shell: pwsh | ||
| run: | | ||
| Invoke-WebRequest -Uri "https://github.com/VSCodium/vscodium/releases/download/${{ env.VSCODIUM_VERSION }}/VSCodium-win32-x64-${{ env.VSCODIUM_VERSION }}.zip" -OutFile vscodium.zip | ||
| Expand-Archive -Path vscodium.zip -DestinationPath VSCodium-win32-x64 | ||
| - name: Apply CodeEX Branding | ||
| shell: pwsh | ||
| run: | | ||
| # Update product.json | ||
| $productPath = "VSCodium-win32-x64/resources/app/product.json" | ||
| $product = Get-Content $productPath | ConvertFrom-Json | ||
| $product.nameShort = "${{ env.APP_NAME }}" | ||
| $product.nameLong = "${{ env.PRODUCT_NAME }}" | ||
| $product.applicationName = "codex" | ||
| $product.win32AppId = "{{CODEX-AGEIXTIC-IDE}}" | ||
| $product | ConvertTo-Json -Depth 10 | Set-Content $productPath | ||
| - name: Install Extensions | ||
| shell: pwsh | ||
| run: | | ||
| $extDir = "VSCodium-win32-x64/resources/app/extensions" | ||
| Get-ChildItem -Path "extensions" -Directory | ForEach-Object { | ||
| $extName = $_.Name | ||
| $destPath = Join-Path $extDir $extName | ||
| Copy-Item -Path $_.FullName -Destination $destPath -Recurse | ||
| Write-Host "Installed extension: $extName" | ||
| } | ||
| - name: Create Installer | ||
| shell: pwsh | ||
| run: | | ||
| Compress-Archive -Path "VSCodium-win32-x64/*" -DestinationPath "CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-win-x64.zip" | ||
| - name: Upload Artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: CodeEX-windows-x64 | ||
| path: CodeEX-Ageixtic-IDE-*-win-x64.zip | ||
| build-linux: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout CodeEX | ||
| uses: actions/checkout@v4 | ||
| - name: Download VSCodium | ||
| run: | | ||
| curl -L -o vscodium.tar.gz "https://github.com/VSCodium/vscodium/releases/download/${{ env.VSCODIUM_VERSION }}/VSCodium-linux-x64-${{ env.VSCODIUM_VERSION }}.tar.gz" | ||
| mkdir -p VSCodium-linux-x64 | ||
| tar -xzf vscodium.tar.gz -C VSCodium-linux-x64 | ||
| - name: Apply CodeEX Branding | ||
| run: | | ||
| # Update product.json | ||
| PRODUCT_PATH="VSCodium-linux-x64/resources/app/product.json" | ||
| jq '.nameShort = "${{ env.APP_NAME }}" | .nameLong = "${{ env.PRODUCT_NAME }}" | .applicationName = "codex"' "$PRODUCT_PATH" > tmp.json && mv tmp.json "$PRODUCT_PATH" | ||
| # Rename binary | ||
| if [ -f "VSCodium-linux-x64/codium" ]; then | ||
| mv "VSCodium-linux-x64/codium" "VSCodium-linux-x64/codex" | ||
| fi | ||
| - name: Install Extensions | ||
| run: | | ||
| EXT_DIR="VSCodium-linux-x64/resources/app/extensions" | ||
| for ext in extensions/*/; do | ||
| if [ -f "$ext/package.json" ]; then | ||
| ext_name=$(basename "$ext") | ||
| mkdir -p "$EXT_DIR/$ext_name" | ||
| cp -r "$ext"/* "$EXT_DIR/$ext_name/" | ||
| echo "Installed extension: $ext_name" | ||
| fi | ||
| done | ||
| - name: Create tar.gz | ||
| run: | | ||
| tar -czvf "CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-linux-x64.tar.gz" \ | ||
| -C . "VSCodium-linux-x64" | ||
| - name: Upload Artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: CodeEX-linux-x64 | ||
| path: CodeEX-Ageixtic-IDE-*-linux-x64.tar.gz | ||
| create-release: | ||
| needs: [build-macos-arm64, build-macos-x64, build-windows, build-linux] | ||
| runs-on: ubuntu-latest | ||
| if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.create_release == 'true' | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| - name: Create Release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| tag_name: v${{ env.CODEX_VERSION }} | ||
| name: CodeEX v${{ env.CODEX_VERSION }} | ||
| draft: false | ||
| prerelease: false | ||
| files: | | ||
| CodeEX-macos-arm64/* | ||
| CodeEX-macos-x64/* | ||
| CodeEX-windows-x64/* | ||
| CodeEX-linux-x64/* | ||
| body: | | ||
| ## CodeEX - Ageixtic IDE v${{ env.CODEX_VERSION }} | ||
| ### Downloads | ||
| - **macOS Apple Silicon**: CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-arm64.dmg | ||
| - **macOS Intel**: CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-x64.dmg | ||
| - **Windows x64**: CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-win-x64.zip | ||
| - **Linux x64**: CodeEX-Ageixtic-IDE-${{ env.CODEX_VERSION }}-linux-x64.tar.gz | ||
| ### Included Extensions | ||
| - Ageixtic Core - Ollama AI integration | ||
| - Quota Manager - Token usage tracking | ||
| - Session Protector - Workspace state preservation | ||
| ### Verification | ||
| macOS builds are signed with Developer ID and notarized by Apple. | ||