This repository was archived by the owner on Aug 15, 2025. It is now read-only.
Refactor Desktop App to use Golem CLI and Golem Yaml #84
Workflow file for this run
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: "Desktop CI" | |
| on: | |
| pull_request: | |
| paths: | |
| - "desktop-app/**" | |
| - ".github/workflows/desktop-ci.yaml" | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*.*.*" | |
| paths: | |
| - "desktop-app/**" | |
| - ".github/workflows/desktop-ci.yaml" | |
| jobs: | |
| build-tauri: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: macos-latest | |
| target: aarch64-apple-darwin | |
| - platform: macos-latest | |
| target: x86_64-apple-darwin | |
| - platform: ubuntu-22.04 | |
| target: "" | |
| - platform: windows-latest | |
| target: "" | |
| # Run on the appropriate runner for each platform | |
| runs-on: ${{ matrix.platform == 'ubuntu-22.04' && 'blacksmith' || matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target != '' && matrix.target || '' }} | |
| - name: Setup Rust cache (Ubuntu) | |
| if: matrix.platform == 'ubuntu-22.04' | |
| uses: useblacksmith/rust-cache@v3 | |
| with: | |
| workspaces: "./desktop-app/src-tauri -> target" | |
| - name: Setup Rust cache (macOS and Windows) | |
| if: matrix.platform != 'ubuntu-22.04' | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "./desktop-app/src-tauri -> target" | |
| - name: Install dependencies (Ubuntu only) | |
| if: matrix.platform == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Install frontend dependencies | |
| run: npm install --force | |
| working-directory: ./desktop-app | |
| - name: Build Tauri apps | |
| id: tauri-build | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| args: ${{ matrix.target != '' && format('--target {0}', matrix.target) || '' }} | |
| projectPath: "./desktop-app" | |
| - name: Upload macOS DMG artifact | |
| if: matrix.platform == 'macos-latest' && matrix.target != '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GolemDesktop-${{ matrix.target }}-dmg | |
| path: ./desktop-app/src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg | |
| if-no-files-found: ignore | |
| - name: Upload macOS App artifact | |
| if: matrix.platform == 'macos-latest' && matrix.target != '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GolemDesktop-${{ matrix.target }}-app | |
| path: ./desktop-app/src-tauri/target/${{ matrix.target }}/release/bundle/macos/*.app | |
| if-no-files-found: ignore | |
| - name: Upload Linux AppImage artifact | |
| if: matrix.platform == 'ubuntu-22.04' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GolemDesktop-linux-appimage | |
| path: ./desktop-app/src-tauri/target/release/bundle/appimage/*.AppImage | |
| if-no-files-found: ignore | |
| - name: Upload Linux Deb artifact | |
| if: matrix.platform == 'ubuntu-22.04' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GolemDesktop-linux-deb | |
| path: ./desktop-app/src-tauri/target/release/bundle/deb/*.deb | |
| if-no-files-found: ignore | |
| - name: Upload Linux RPM artifact | |
| if: matrix.platform == 'ubuntu-22.04' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GolemDesktop-linux-rpm | |
| path: ./desktop-app/src-tauri/target/release/bundle/rpm/*.rpm | |
| if-no-files-found: ignore | |
| - name: Upload Windows MSI artifact | |
| if: matrix.platform == 'windows-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GolemDesktop-windows-msi | |
| path: ./desktop-app/src-tauri/target/release/bundle/msi/*.msi | |
| if-no-files-found: ignore | |
| - name: Upload Windows EXE artifact | |
| if: matrix.platform == 'windows-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GolemDesktop-windows-exe | |
| path: ./desktop-app/src-tauri/target/release/bundle/nsis/*.exe | |
| if-no-files-found: ignore | |
| publish-release: | |
| needs: build-tauri | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Display structure of downloaded files | |
| run: ls -R artifacts | |
| - name: Extract and organize artifacts | |
| run: | | |
| mkdir -p release-files | |
| find artifacts -type f -name "*.dmg" | while read f; do | |
| if [[ "$f" == *"aarch64"* ]]; then | |
| cp "$f" release-files/GolemDesktop-macos-arm64.dmg | |
| elif [[ "$f" == *"x86_64"* ]]; then | |
| cp "$f" release-files/GolemDesktop-macos-x64.dmg | |
| fi | |
| done | |
| find artifacts -type f -name "*.AppImage" | while read f; do cp "$f" release-files/GolemDesktop-linux.AppImage; done | |
| find artifacts -type f -name "*.deb" | while read f; do cp "$f" release-files/GolemDesktop-linux.deb; done | |
| find artifacts -type f -name "*.rpm" | while read f; do cp "$f" release-files/GolemDesktop-linux.rpm; done | |
| find artifacts -type f -name "*.msi" | while read f; do cp "$f" release-files/GolemDesktop-windows.msi; done | |
| find artifacts -type f -name "*.exe" | grep -v "unins" | while read f; do cp "$f" release-files/GolemDesktop-windows-setup.exe; done | |
| echo "Files ready for release:" | |
| ls -la release-files | |
| - name: Update artifacts on existing GitHub release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/} | |
| if ! gh release view $TAG &>/dev/null; then | |
| echo "Release $TAG does not exist. Will not create a new release." | |
| exit 0 | |
| fi | |
| echo "Found existing release $TAG. Updating artifacts..." | |
| find release-files -type f | while read artifact; do | |
| filename=$(basename "$artifact") | |
| echo "Uploading $filename to release $TAG" | |
| gh release upload $TAG "$artifact" --clobber | |
| done | |
| echo "Successfully updated artifacts on release $TAG" |