# This is a **reuseable** workflow that bundles the Desktop App for Linux. # It doesn't get triggered on its own. It gets used in multiple workflows: # - release.yml # - canary.yml (when added) # - pr-comment-bundle-desktop.yml (when added) on: workflow_dispatch: inputs: branch: description: 'Branch name to bundle app from' required: true type: string workflow_call: inputs: version: description: 'Version to set for the build' required: false default: "" type: string ref: type: string required: false default: '' name: "Bundle Desktop (Linux)" jobs: build-desktop-linux: name: Build Desktop (Linux, ${{ matrix.variant }}) runs-on: ${{ matrix.build-on }} strategy: fail-fast: false matrix: include: - variant: standard build-on: ubuntu-22.04 - variant: vulkan build-on: ubuntu-24.04 steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ inputs.ref || inputs.branch }} - name: Update versions if: ${{ inputs.version != '' }} run: | # Update version in Cargo.toml sed -i.bak 's/^version = ".*"/version = "'${{ inputs.version }}'"/' Cargo.toml rm -f Cargo.toml.bak # Update version in package.json source ./bin/activate-hermit cd ui/desktop npm pkg set "version=${{ inputs.version }}" - name: Debug workflow info env: WORKFLOW_NAME: ${{ github.workflow }} WORKFLOW_REF: ${{ github.ref }} EVENT_NAME: ${{ github.event_name }} REPOSITORY: ${{ github.repository }} run: | echo "=== Workflow Information ===" echo "Workflow: ${WORKFLOW_NAME}" echo "Ref: ${WORKFLOW_REF}" echo "Event: ${EVENT_NAME}" echo "Repo: ${REPOSITORY}" echo "" echo "=== System Information ===" uname -a lsb_release -a || true df -h - name: Install system dependencies run: | sudo apt-get update sudo apt-get install -y \ build-essential \ libnss3-dev \ libatk-bridge2.0-dev \ libdrm2 \ libxcomposite1 \ libxdamage1 \ libxrandr2 \ libgbm1 \ libxss1 \ rpm \ fakeroot \ dpkg-dev \ protobuf-compiler \ flatpak \ flatpak-builder \ elfutils if [ "${{ matrix.variant }}" = "vulkan" ]; then sudo apt-get install -y \ libasound2t64 \ libvulkan-dev \ libvulkan1 \ glslc else sudo apt-get install -y libasound2 fi - name: Setup Flatpak Runtimes run: | flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo - name: Activate hermit and set CARGO_HOME run: | source bin/activate-hermit echo "CARGO_HOME=$CARGO_HOME" >> $GITHUB_ENV echo "RUSTUP_HOME=$RUSTUP_HOME" >> $GITHUB_ENV - name: Cache Rust dependencies uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 with: key: linux-${{ matrix.build-on }}-${{ matrix.variant }} - name: Build goosed binary env: RUST_LOG: debug RUST_BACKTRACE: 1 run: | source ./bin/activate-hermit export TARGET="x86_64-unknown-linux-gnu" rustup target add "${TARGET}" FEATURE_ARGS=() if [ "${{ matrix.variant }}" = "vulkan" ]; then FEATURE_ARGS=(--features vulkan) fi cargo build --release --target ${TARGET} -p goose-server "${FEATURE_ARGS[@]}" - name: Copy binaries into Electron folder run: | echo "Copying binaries to ui/desktop/src/bin/" export TARGET="x86_64-unknown-linux-gnu" mkdir -p ui/desktop/src/bin cp target/$TARGET/release/goosed ui/desktop/src/bin/ chmod +x ui/desktop/src/bin/goosed ls -la ui/desktop/src/bin/ - name: Cache pnpm dependencies uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 with: path: | ui/desktop/node_modules .hermit/node/cache key: linux-pnpm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/pnpm-lock.yaml') }} restore-keys: | linux-pnpm-cache-v1-${{ runner.os }}- - name: Install pnpm dependencies run: | source ./bin/activate-hermit cd ui/desktop pnpm install --frozen-lockfile # Verify installation ls -la node_modules/.bin/ | head -5 - name: Build Linux packages env: GOOSE_DESKTOP_LINUX_VARIANT: ${{ matrix.variant }} run: | source ./bin/activate-hermit cd ui/desktop echo "Building Linux packages (.deb, .rpm, and .flatpak) for ${{ matrix.variant }}..." # Build all configured packages pnpm run make --platform=linux --arch=x64 if [ "${{ matrix.variant }}" = "vulkan" ]; then for package in out/make/deb/x64/*.deb out/make/rpm/x64/*.rpm out/make/flatpak/x86_64/*.flatpak; do [ -e "$package" ] || continue extension="${package##*.}" base="${package%.*}" mv "$package" "${base}-vulkan.${extension}" done fi echo "Build completed. Checking output..." ls -la out/ find out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak" | head -10 - name: List generated files run: | echo "=== All files in out/ directory ===" find ui/desktop/out/ -type f | head -20 echo "" echo "=== Package files specifically ===" find ui/desktop/out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak" echo "" echo "=== File sizes ===" find ui/desktop/out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak" -exec ls -lh {} \; - name: Upload .deb package if: matrix.variant == 'standard' uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: Goose-linux-x64-deb path: ui/desktop/out/make/deb/x64/*.deb if-no-files-found: error - name: Upload .deb package (Vulkan) if: matrix.variant == 'vulkan' uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: Goose-linux-x64-vulkan-deb path: ui/desktop/out/make/deb/x64/*-vulkan.deb if-no-files-found: error - name: Upload .rpm package if: matrix.variant == 'standard' uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: Goose-linux-x64-rpm path: ui/desktop/out/make/rpm/x64/*.rpm if-no-files-found: error - name: Upload .rpm package (Vulkan) if: matrix.variant == 'vulkan' uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: Goose-linux-x64-vulkan-rpm path: ui/desktop/out/make/rpm/x64/*-vulkan.rpm if-no-files-found: error - name: Upload .flatpak package if: matrix.variant == 'standard' uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: Goose-linux-x64-flatpak path: ui/desktop/out/make/flatpak/x86_64/*.flatpak if-no-files-found: error - name: Upload .flatpak package (Vulkan) if: matrix.variant == 'vulkan' uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: Goose-linux-x64-vulkan-flatpak path: ui/desktop/out/make/flatpak/x86_64/*-vulkan.flatpak if-no-files-found: error