Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Trim Desktop workflow checkouts and reuse Linux cloud tooling (#649)

Dee67b4659542b7
diff --git a/.github/workflows/desktop-cache.yml b/.github/workflows/desktop-cache.yml
index 62c59e0b4..f4d2b45a3 100644
--- a/.github/workflows/desktop-cache.yml
+++ b/.github/workflows/desktop-cache.yml
@@ -39,6 +39,13 @@ jobs:
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
+ with:
+ sparse-checkout: |
+ /desktop/
+ /.github/actions/
+ /.github/workflows/release-desktop.yml
+ /mobile/pubspec.lock
+ sparse-checkout-cone-mode: false
- id: toolchain
run: |
version="$(sed -n "s/^ FLUTTER_VERSION: '\([^']*\)'.*/\1/p" .github/workflows/release-desktop.yml)"
diff --git a/.github/workflows/desktop-internal-build.yml b/.github/workflows/desktop-internal-build.yml
index ccf278aed..401291feb 100644
--- a/.github/workflows/desktop-internal-build.yml
+++ b/.github/workflows/desktop-internal-build.yml
@@ -78,6 +78,10 @@ jobs:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # release-desktop.sh reads every tag and checks HEAD is on the branch
+ sparse-checkout: |
+ /desktop/scripts/release-desktop.sh
+ /.github/workflows/release-desktop.yml
+ sparse-checkout-cone-mode: false
- id: plan
# Through env, never `${{ }}` inline in run: — a ref name may carry quotes and $().
@@ -125,6 +129,15 @@ jobs:
working-directory: desktop
steps:
- uses: actions/checkout@v7
+ with:
+ # Match the release's complete Desktop source and packaging inputs.
+ sparse-checkout: |
+ /desktop/
+ /.github/actions/
+ /scripts/validate-change.py
+ /scripts/verify-desktop-release.py
+ /mobile/pubspec.lock
+ sparse-checkout-cone-mode: false
- uses: ./.github/actions/desktop-flutter
with:
diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml
index 16bfefc84..8f9a4c7d9 100644
--- a/.github/workflows/release-desktop.yml
+++ b/.github/workflows/release-desktop.yml
@@ -245,6 +245,16 @@ jobs:
working-directory: desktop
steps:
- uses: actions/checkout@v7
+ with:
+ # Keep the entire Desktop component and its shared packaging helpers.
+ # The mobile lock is included only to preserve the existing pub-cache key.
+ sparse-checkout: |
+ /desktop/
+ /.github/actions/
+ /scripts/validate-change.py
+ /scripts/verify-desktop-release.py
+ /mobile/pubspec.lock
+ sparse-checkout-cone-mode: false
# main prepares shared caches. A release only restores: per-tag uploads cannot
# help the next tag and added 81s after the 1.2.51 macOS build had finished.
@@ -322,6 +332,12 @@ jobs:
working-directory: desktop
steps:
- uses: actions/checkout@v7
+ with:
+ sparse-checkout: |
+ /desktop/
+ /.github/actions/
+ /mobile/pubspec.lock
+ sparse-checkout-cone-mode: false
- name: Install the Linux desktop toolchain
run: |
@@ -360,7 +376,7 @@ jobs:
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- - uses: google-github-actions/setup-gcloud@v2
+ - uses: ./.github/actions/setup-gcloud
- name: Build and upload linux-${{ matrix.arch }}
env:
@@ -448,6 +464,9 @@ jobs:
- uses: actions/checkout@v7
with:
fetch-depth: 1
+ # Notes come from Git objects; no app source or artwork is needed.
+ sparse-checkout: /.github/workflows/release-desktop.yml
+ sparse-checkout-cone-mode: false
- name: Take the release notes from the tag
if: github.event_name == 'push'
diff --git a/docs/validation-and-release.md b/docs/validation-and-release.md
index 9f315ebdd..6873996a5 100644
--- a/docs/validation-and-release.md
+++ b/docs/validation-and-release.md
@@ -68,6 +68,13 @@ their own key, with the full SDK for the exact same version as a fallback. Cache
preparation covers macOS and both Linux architectures. Signing, notarization and
artifact checks remain required.
+Desktop build jobs check out the complete `desktop/` component, their local
+actions and shared packaging helpers. Keep these sparse checkout inputs current
+if a build starts using another component. The existing pub-cache key also reads
+`mobile/pubspec.lock`, which remains included so sparse and full checkouts restore
+the same dependency cache. Linux builders reuse a working Google Cloud CLI at or
+above the validated version, with the normal install path as a fallback.
+
### Package Desktop while final checks run
When the final implementation is pushed, start `make release-desktop ARGS="--prepare"`