Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
Cache desktop build assets in CI and release workflows (#2543)
Julius Marminge6c79039ce752
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex e3329b1da..c4ec149d5 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -25,8 +25,9 @@ jobs:with:node-version-file: package.json- - name: Cache Bun and Turbo- uses: actions/cache@v5+ - id: bun_turbo_cache+ name: Restore Bun and Turbo cache+ uses: actions/cache/restore@v5with:path: |~/.bun/install/cache@@ -35,8 +36,9 @@ jobs:restore-keys: |${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-- - name: Cache Playwright browsers- uses: actions/cache@v5+ - id: playwright_cache+ name: Restore Playwright browsers+ uses: actions/cache/restore@v5with:path: ~/.cache/ms-playwrightkey: ${{ runner.os }}-playwright-${{ hashFiles('bun.lock') }}@@ -69,6 +71,22 @@ jobs:- name: Build desktop pipelinerun: bun run build:desktop+ - name: Save Playwright browsers+ if: steps.playwright_cache.outputs.cache-hit != 'true'+ uses: actions/cache/save@v5+ with:+ path: ~/.cache/ms-playwright+ key: ${{ runner.os }}-playwright-${{ hashFiles('bun.lock') }}++ - name: Save Bun and Turbo cache+ if: steps.bun_turbo_cache.outputs.cache-hit != 'true'+ uses: actions/cache/save@v5+ with:+ path: |+ ~/.bun/install/cache+ .turbo+ key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-${{ hashFiles('turbo.json') }}+- name: Verify preload bundle outputrun: |test -f apps/desktop/dist-electron/preload.cjsdiff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 4409c54c8..eace4caec 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -311,7 +311,9 @@ jobs:shell: bashrun: |set -euo pipefail- mkdir -p release-publish+ asset_dir="release-artifacts/desktop-${{ matrix.platform }}-${{ matrix.arch }}"+ rm -rf "$asset_dir"+ mkdir -p "$asset_dir"shopt -s nullglobfor pattern in \@@ -322,13 +324,13 @@ jobs:"release/*.blockmap" \"release/*.yml"; dofor file in $pattern; do- cp "$file" release-publish/+ cp "$file" "$asset_dir"/donedoneif [[ "${{ matrix.platform }}" == "mac" && "${{ matrix.arch }}" != "arm64" ]]; thenshopt -s nullglob- for manifest in release-publish/*-mac.yml; do+ for manifest in "$asset_dir"/*-mac.yml; domv "$manifest" "${manifest%.yml}-${{ matrix.arch }}.yml"donefi@@ -340,17 +342,23 @@ jobs:# canonical manifest per channel.# if [[ "${{ matrix.platform }}" == "win" ]]; then# shopt -s nullglob- # for manifest in release-publish/*.yml; do+ # for manifest in "$asset_dir"/*.yml; do# mv "$manifest" "${manifest%.yml}-win-${{ matrix.arch }}.yml"# done# fi- - name: Upload build artifacts- uses: actions/upload-artifact@v7+ assets=("$asset_dir"/*)+ if (( ${#assets[@]} == 0 )); then+ echo "No release assets were collected for ${{ matrix.platform }} ${{ matrix.arch }}." >&2+ exit 1+ fi++ - name: Save build artifacts+ uses: actions/cache/save@v5with:- name: desktop-${{ matrix.platform }}-${{ matrix.arch }}- path: release-publish/*- if-no-files-found: error+ path: release-artifacts/desktop-${{ matrix.platform }}-${{ matrix.arch }}+ key: release-assets-${{ github.run_id }}-${{ matrix.platform }}-${{ matrix.arch }}-${{ github.run_attempt }}+ enableCrossOsArchive: truepublish_cli:name: Publish CLI to npm@@ -423,12 +431,70 @@ jobs:- name: Install dependenciesrun: bun install --frozen-lockfile --filter=@t3tools/scripts- - name: Download all desktop artifacts- uses: actions/download-artifact@v8+ # Keep these restore steps in sync with the desktop build matrix.+ # Cache restore cannot enumerate a key pattern like download-artifact did.+ - name: Restore macOS arm64 desktop assets+ uses: actions/cache/restore@v5+ with:+ path: release-artifacts/desktop-mac-arm64+ key: release-assets-${{ github.run_id }}-mac-arm64-${{ github.run_attempt }}+ restore-keys: |+ release-assets-${{ github.run_id }}-mac-arm64-+ fail-on-cache-miss: true+ enableCrossOsArchive: true++ - name: Restore macOS x64 desktop assets+ uses: actions/cache/restore@v5+ with:+ path: release-artifacts/desktop-mac-x64+ key: release-assets-${{ github.run_id }}-mac-x64-${{ github.run_attempt }}+ restore-keys: |+ release-assets-${{ github.run_id }}-mac-x64-+ fail-on-cache-miss: true+ enableCrossOsArchive: true++ - name: Restore Linux x64 desktop assets+ uses: actions/cache/restore@v5with:- pattern: desktop-*- merge-multiple: true- path: release-assets+ path: release-artifacts/desktop-linux-x64+ key: release-assets-${{ github.run_id }}-linux-x64-${{ github.run_attempt }}+ restore-keys: |+ release-assets-${{ github.run_id }}-linux-x64-+ fail-on-cache-miss: true+ enableCrossOsArchive: true++ - name: Restore Windows x64 desktop assets+ uses: actions/cache/restore@v5+ with:+ path: release-artifacts/desktop-win-x64+ key: release-assets-${{ github.run_id }}-win-x64-${{ github.run_attempt }}+ restore-keys: |+ release-assets-${{ github.run_id }}-win-x64-+ fail-on-cache-miss: true+ enableCrossOsArchive: true++ - name: Stage desktop assets+ shell: bash+ run: |+ set -euo pipefail+ rm -rf release-assets+ mkdir -p release-assets++ shopt -s nullglob+ for dir in release-artifacts/desktop-*; do+ files=("$dir"/*)+ if (( ${#files[@]} == 0 )); then+ echo "No release assets were restored from $dir." >&2+ exit 1+ fi+ cp "${files[@]}" release-assets/+ done++ assets=(release-assets/*)+ if (( ${#assets[@]} == 0 )); then+ echo "No desktop release assets were staged." >&2+ exit 1+ fi- name: Merge macOS updater manifestsrun: |