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.

ci: federate the last two workflows, and retire gsutil (#68)

autonomousdevopsa56753d5b266
diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml
index 6327f15b6..5bcdcd652 100644
--- a/.github/workflows/release-desktop.yml
+++ b/.github/workflows/release-desktop.yml
@@ -121,8 +121,36 @@ jobs:
# means a broken one costs seconds. Runs beside `version`, so it is free in wall clock.
preflight:
runs-on: ubuntu-latest
+ env:
+ # The `secrets` context cannot be read from a step-level `if:`, so reduce it to a boolean
+ # here — job-level `env:` can see it. Holds "true"/"false", never the value itself.
+ HAS_WIF: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER != '' }}
steps:
- - uses: google-github-actions/auth@v2
+ # GCP auth, WITHOUT a long-lived key — the same pattern release.yml and production-be-build.yaml
+ # already run. A service-account JSON key is a bearer credential with no expiry: it is only as
+ # safe as every place it has ever been copied to. Workload Identity Federation replaces it with
+ # a short-lived token minted from this job's own OIDC identity (hence `id-token: write` above),
+ # so there is nothing to leak and nothing to rotate.
+ #
+ # This workflow was the one left on the key when the rest of the repo federated; it is also why
+ # every GCS call below is `gcloud storage` and not `gsutil`. gsutil is a standalone Python tool
+ # that cannot use the external-account credential WIF issues, so it fails on every call while
+ # the identical `gcloud storage` call works. Do not reintroduce gsutil here.
+ #
+ # Two steps, not one, only for the duration of the cutover: WIF whenever the
+ # GCP_WORKLOAD_IDENTITY_PROVIDER secret exists, the key only when it does not. DELETE the
+ # second step (and the GCP_SA_KEY secret, and the key itself in GCP) once a desktop release has
+ # gone green on the first — an unused key that still authenticates is still a liability.
+ # NOTE release-tmux-runtime.yml still uses the key: check it before deleting the secret.
+ - name: Authenticate to GCP (workload identity federation)
+ if: env.HAS_WIF == 'true'
+ uses: google-github-actions/auth@v2
+ with:
+ workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
+ service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
+ - name: Authenticate to GCP (service-account key — legacy fallback)
+ if: env.HAS_WIF != 'true'
+ uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- uses: google-github-actions/setup-gcloud@v2
@@ -130,8 +158,8 @@ jobs:
run: |
set -euo pipefail
probe="gs://${GCS_BUCKET}/harness/desktop/.ci-preflight/${GITHUB_RUN_ID}"
- echo "$GITHUB_RUN_ID" | gsutil cp - "$probe"
- gsutil rm "$probe"
+ echo "$GITHUB_RUN_ID" | gcloud storage cp - "$probe"
+ gcloud storage rm "$probe"
# BOTH macOS builds, side by side: one universal app built twice, differing only in its renderer
# (Intel on Skia, Apple Silicon on Impeller — RELEASE.md, "Two macOS builds"). A macos-15 runner is
@@ -151,6 +179,9 @@ jobs:
# The script's own env override, pointed at this build's scratch file instead of the real
# manifest. The artifacts still land on their real GCS paths; only the keys land here.
METADATA_PATH: ${{ needs.version.outputs.scratch_prefix }}/macos-${{ matrix.variant }}.json
+ # The `secrets` context cannot be read from a step-level `if:`, so reduce it to a boolean
+ # here — job-level `env:` can see it. Holds "true"/"false", never the value itself.
+ HAS_WIF: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER != '' }}
defaults:
run:
working-directory: desktop
@@ -183,7 +214,15 @@ jobs:
apple-team-id: ${{ secrets.APPLE_TEAM_ID }}
apple-app-password: ${{ secrets.APPLE_APP_PASSWORD }}
- - uses: google-github-actions/auth@v2
+ - name: Authenticate to GCP (workload identity federation)
+ if: env.HAS_WIF == 'true'
+ uses: google-github-actions/auth@v2
+ with:
+ workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
+ service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
+ - name: Authenticate to GCP (service-account key — legacy fallback)
+ if: env.HAS_WIF != 'true'
+ uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- uses: google-github-actions/setup-gcloud@v2
@@ -221,6 +260,9 @@ jobs:
env:
TARGET_ARCH: ${{ matrix.arch }}
METADATA_PATH: ${{ needs.version.outputs.scratch_prefix }}/linux-${{ matrix.arch }}.json
+ # The `secrets` context cannot be read from a step-level `if:`, so reduce it to a boolean
+ # here — job-level `env:` can see it. Holds "true"/"false", never the value itself.
+ HAS_WIF: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER != '' }}
defaults:
run:
working-directory: desktop
@@ -278,7 +320,15 @@ jobs:
chmod +x "$RUNNER_TEMP/appimagetool"
echo "APPIMAGETOOL=$RUNNER_TEMP/appimagetool" >> "$GITHUB_ENV"
- - uses: google-github-actions/auth@v2
+ - name: Authenticate to GCP (workload identity federation)
+ if: env.HAS_WIF == 'true'
+ uses: google-github-actions/auth@v2
+ with:
+ workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
+ service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
+ - name: Authenticate to GCP (service-account key — legacy fallback)
+ if: env.HAS_WIF != 'true'
+ uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- uses: google-github-actions/setup-gcloud@v2
@@ -296,8 +346,19 @@ jobs:
env:
METADATA_PATH: ${{ needs.version.outputs.metadata_path }}
SCRATCH_PREFIX: ${{ needs.version.outputs.scratch_prefix }}
+ # The `secrets` context cannot be read from a step-level `if:`, so reduce it to a boolean
+ # here — job-level `env:` can see it. Holds "true"/"false", never the value itself.
+ HAS_WIF: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER != '' }}
steps:
- - uses: google-github-actions/auth@v2
+ - name: Authenticate to GCP (workload identity federation)
+ if: env.HAS_WIF == 'true'
+ uses: google-github-actions/auth@v2
+ with:
+ workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
+ service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
+ - name: Authenticate to GCP (service-account key — legacy fallback)
+ if: env.HAS_WIF != 'true'
+ uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- uses: google-github-actions/setup-gcloud@v2
@@ -306,11 +367,11 @@ jobs:
run: |
set -euo pipefail
mkdir -p parts
- gsutil -m cp "gs://${GCS_BUCKET}/${SCRATCH_PREFIX}/*.json" parts/
+ gcloud storage cp "gs://${GCS_BUCKET}/${SCRATCH_PREFIX}/*.json" parts/
echo "::group::scratch manifests"; ls -la parts; echo "::endgroup::"
src="$(mktemp)"; dst="$(mktemp)"
- if ! gsutil cp "gs://${GCS_BUCKET}/${METADATA_PATH}" "$src" 2>/dev/null; then
+ if ! gcloud storage cp "gs://${GCS_BUCKET}/${METADATA_PATH}" "$src" 2>/dev/null; then
echo " (no existing manifest at ${METADATA_PATH} — creating a new one)"
printf '{}' > "$src"
fi
@@ -351,9 +412,9 @@ jobs:
json.dump(data, f, indent=2)
f.write("\n")
PY
- gsutil -h "Content-Type:application/json" \
- -h "Cache-Control:no-cache, no-store, must-revalidate" \
- cp "$dst" "gs://${GCS_BUCKET}/${METADATA_PATH}"
+ gcloud storage cp --content-type=application/json \
+ --cache-control="no-cache, no-store, must-revalidate" \
+ "$dst" "gs://${GCS_BUCKET}/${METADATA_PATH}"
echo "Published to \`${METADATA_PATH}\`" >> "$GITHUB_STEP_SUMMARY"
# The GitHub Release. Notes are the tag's OWN message, verbatim — the same rule
@@ -430,12 +491,24 @@ jobs:
needs: [version, build-macos, build-linux, publish]
if: always()
runs-on: ubuntu-latest
+ env:
+ # The `secrets` context cannot be read from a step-level `if:`, so reduce it to a boolean
+ # here — job-level `env:` can see it. Holds "true"/"false", never the value itself.
+ HAS_WIF: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER != '' }}
steps:
- - uses: google-github-actions/auth@v2
+ - name: Authenticate to GCP (workload identity federation)
+ if: env.HAS_WIF == 'true'
+ uses: google-github-actions/auth@v2
+ with:
+ workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
+ service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
+ - name: Authenticate to GCP (service-account key — legacy fallback)
+ if: env.HAS_WIF != 'true'
+ uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- uses: google-github-actions/setup-gcloud@v2
- name: Remove the scratch manifests
env:
SCRATCH_PREFIX: ${{ needs.version.outputs.scratch_prefix }}
- run: gsutil -m rm -r "gs://${GCS_BUCKET}/${SCRATCH_PREFIX}" || true
+ run: gcloud storage rm -r "gs://${GCS_BUCKET}/${SCRATCH_PREFIX}" || true
diff --git a/.github/workflows/release-tmux-runtime.yml b/.github/workflows/release-tmux-runtime.yml
index ef77eea89..404b755bf 100644
--- a/.github/workflows/release-tmux-runtime.yml
+++ b/.github/workflows/release-tmux-runtime.yml
@@ -27,6 +27,7 @@ on:
permissions:
contents: read
+ id-token: write # only used by the Workload Identity Federation variant of the auth steps below
env:
GCS_BUCKET: s3-autonomous-upgrade-3
@@ -36,8 +37,35 @@ jobs:
preflight:
if: ${{ inputs.publish }}
runs-on: ubuntu-latest
+ env:
+ # The `secrets` context cannot be read from a step-level `if:`, so reduce it to a boolean
+ # here — job-level `env:` can see it. Holds "true"/"false", never the value itself.
+ HAS_WIF: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER != '' }}
steps:
- - uses: google-github-actions/auth@v2
+ # GCP auth, WITHOUT a long-lived key — the same pattern release.yml, release-desktop.yml and
+ # production-be-build.yaml already run. A service-account JSON key is a bearer credential with
+ # no expiry: it is only as safe as every place it has ever been copied to. Workload Identity
+ # Federation replaces it with a short-lived token minted from this job's own OIDC identity
+ # (hence `id-token: write` above), so there is nothing to leak and nothing to rotate.
+ #
+ # Note that every GCS call below — and in publish-managed-tmux-runtime.sh — is `gcloud storage`
+ # and not `gsutil`. gsutil is a standalone Python tool that cannot use the external-account
+ # credential WIF issues, so it fails on every call while the identical `gcloud storage` call
+ # works. Do not reintroduce gsutil here.
+ #
+ # Two steps, not one, only for the duration of the cutover: WIF whenever the
+ # GCP_WORKLOAD_IDENTITY_PROVIDER secret exists, the key only when it does not. DELETE the
+ # second step (and the GCP_SA_KEY secret, and the key itself in GCP) once a publish has gone
+ # green on the first — an unused key that still authenticates is still a liability.
+ - name: Authenticate to GCP (workload identity federation)
+ if: env.HAS_WIF == 'true'
+ uses: google-github-actions/auth@v2
+ with:
+ workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
+ service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
+ - name: Authenticate to GCP (service-account key — legacy fallback)
+ if: env.HAS_WIF != 'true'
+ uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- uses: google-github-actions/setup-gcloud@v2
@@ -45,8 +73,8 @@ jobs:
run: |
set -euo pipefail
probe="gs://${GCS_BUCKET}/harness/runtime/tmux/.ci-preflight/${GITHUB_RUN_ID}"
- echo "$GITHUB_RUN_ID" | gsutil cp - "$probe"
- gsutil rm "$probe"
+ echo "$GITHUB_RUN_ID" | gcloud storage cp - "$probe"
+ gcloud storage rm "$probe"
build:
runs-on: macos-15
@@ -82,6 +110,10 @@ jobs:
if: ${{ inputs.publish }}
needs: [preflight, build]
runs-on: ubuntu-latest
+ env:
+ # The `secrets` context cannot be read from a step-level `if:`, so reduce it to a boolean
+ # here — job-level `env:` can see it. Holds "true"/"false", never the value itself.
+ HAS_WIF: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER != '' }}
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v4
@@ -89,7 +121,15 @@ jobs:
pattern: tmux-${{ inputs.tmux_version }}-*
path: dist
merge-multiple: true
- - uses: google-github-actions/auth@v2
+ - name: Authenticate to GCP (workload identity federation)
+ if: env.HAS_WIF == 'true'
+ uses: google-github-actions/auth@v2
+ with:
+ workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
+ service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
+ - name: Authenticate to GCP (service-account key — legacy fallback)
+ if: env.HAS_WIF != 'true'
+ uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- uses: google-github-actions/setup-gcloud@v2
diff --git a/Makefile b/Makefile
index d518410af..3660fda02 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@ install-cli:
bash cli/scripts/install-cli.sh $(ARGS)
## upload-cli: bump version -> bundle -> publish the CLI. MAINTAINER ONLY — it writes to the release
-## bucket, so it needs an authenticated `gcloud storage` (or gsutil) with write access on it, plus
+## bucket, so it needs an authenticated `gcloud storage` with write access on it, plus
## node/npm for the bundle step.
## Running daemons pick the new version up within ~1 min.
upload-cli:
@@ -68,7 +68,7 @@ remote-machine:
##
## NOT a tag-triggered release like the three above, and deliberately so: this builds with a local
## ESP-IDF toolchain and writes straight to the GCS bucket every running dial polls, so it needs an
-## authenticated gsutil and a sourced IDF env on the machine that runs it. There is no CI runner with
+## authenticated `gcloud storage` and a sourced IDF env on the machine that runs it. There is no CI runner with
## a board attached to check the result. See device/harness/RELEASE.md.
##
## ARGS="--dry-run" to preview, ARGS="X.Y.Z" for an explicit version, ARGS="--no-bump" to rebuild and
diff --git a/cli/scripts/upload-cli.sh b/cli/scripts/upload-cli.sh
index e46cca778..2770461a1 100755
--- a/cli/scripts/upload-cli.sh
+++ b/cli/scripts/upload-cli.sh
@@ -12,7 +12,7 @@
# The CURRENT version is read from the remote metadata.json on GCS (single source of truth) and the
# patch is bumped from there — nothing is git-committed (the version is injected into the bundle via
# ADAPTER_VERSION, so the running binary's version equals the published manifest version).
-# Prereqs: `gcloud storage` (or gsutil) authenticated with WRITE access on the bucket; the
+# Prereqs: `gcloud storage` authenticated with WRITE access on the bucket; the
# bucket/objects must be public-read; `node`+`npm`.
set -euo pipefail
@@ -63,35 +63,27 @@ done
command -v node >/dev/null 2>&1 || { echo "error: node not found" >&2; exit 1; }
-# --- GCS client: `gcloud storage` if we have it, else gsutil ---
-# gsutil is a standalone Python tool that only understands gcloud's *user* and *service-account-key*
-# credentials. It cannot use the external-account (federated) credential that Workload Identity
-# Federation issues, so a CI job authenticated by WIF fails on every gsutil call while the identical
-# `gcloud storage` call works — it is the same gcloud binary that performed the token exchange.
-# gsutil stays as the fallback for a laptop whose SDK predates `gcloud storage`.
-if command -v gcloud >/dev/null 2>&1 && gcloud storage --help >/dev/null 2>&1; then
- GCS_CLI=gcloud
-elif command -v gsutil >/dev/null 2>&1; then
- GCS_CLI=gsutil
- echo ">> note: falling back to gsutil (no 'gcloud storage'); this will not work under workload identity federation" >&2
-else
- echo "error: neither 'gcloud storage' nor gsutil found — install/authenticate the gcloud SDK" >&2
+# --- GCS client: `gcloud storage`, and only `gcloud storage` ---
+# gsutil was retired from this repo on 2026-09-17. It is a standalone Python tool that only
+# understands gcloud's *user* and *service-account-key* credentials: it cannot use the
+# external-account (federated) credential Workload Identity Federation issues, so every call fails
+# under WIF while the identical `gcloud storage` call works — it is the same gcloud binary that
+# performed the token exchange. Every release path here runs on WIF now. Do not reintroduce it.
+command -v gcloud >/dev/null 2>&1 || {
+ echo "error: gcloud not found — install/authenticate the gcloud SDK" >&2
exit 1
-fi
+}
+gcloud storage --help >/dev/null 2>&1 || {
+ echo "error: this gcloud is too old for 'gcloud storage' — update the gcloud SDK" >&2
+ exit 1
+}
# gcs_cp <src> <dst> [cache-control] [content-type] — either side may be gs:// or a local path or `-`.
gcs_cp() {
- local src="$1" dst="$2" cc="${3:-}" ct="${4:-}" args=()
- if [ "$GCS_CLI" = gcloud ]; then
- args=(storage cp)
- if [ -n "$cc" ]; then args+=("--cache-control=$cc"); fi
- if [ -n "$ct" ]; then args+=("--content-type=$ct"); fi
- gcloud "${args[@]}" "$src" "$dst"
- else
- if [ -n "$cc" ]; then args+=(-h "Cache-Control:$cc"); fi
- if [ -n "$ct" ]; then args+=(-h "Content-Type:$ct"); fi
- gsutil "${args[@]}" cp "$src" "$dst"
- fi
+ local src="$1" dst="$2" cc="${3:-}" ct="${4:-}" args=(storage cp)
+ if [ -n "$cc" ]; then args+=("--cache-control=$cc"); fi
+ if [ -n "$ct" ]; then args+=("--content-type=$ct"); fi
+ gcloud "${args[@]}" "$src" "$dst"
}
cleanup() { rm -f "${SRC:-}" "${DST:-}"; }
diff --git a/cli/scripts/upload-install-sh.sh b/cli/scripts/upload-install-sh.sh
index 67cbd4da4..b3914ed0b 100755
--- a/cli/scripts/upload-install-sh.sh
+++ b/cli/scripts/upload-install-sh.sh
@@ -13,7 +13,7 @@
# via `cf-cache-status: BYPASS`), so that is what keeps a publish reaching people promptly. After
# running this, verify the CDN itself serves the new bytes — the command this script prints at the end.
#
-# Prereqs: `gcloud storage` (or gsutil) authenticated with WRITE access on the bucket.
+# Prereqs: `gcloud storage` authenticated with WRITE access on the bucket.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # cli/
@@ -23,16 +23,20 @@ GCS_BUCKET="${GCS_BUCKET:-s3-autonomous-upgrade-3}"
GCS_PATH="harness/cli/install.sh"
CDN_URL="https://cdn.autonomous.ai/${GCS_PATH}"
-# --- GCS client: `gcloud storage` if we have it, else gsutil (see upload-cli.sh for why) ---
-if command -v gcloud >/dev/null 2>&1 && gcloud storage --help >/dev/null 2>&1; then
- GCS_CLI=gcloud
-elif command -v gsutil >/dev/null 2>&1; then
- GCS_CLI=gsutil
- echo ">> note: falling back to gsutil (no 'gcloud storage'); this will not work under workload identity federation" >&2
-else
- echo "error: neither 'gcloud storage' nor gsutil found — install/authenticate the gcloud SDK" >&2
+# --- GCS client: `gcloud storage`, and only `gcloud storage` ---
+# gsutil was retired from this repo on 2026-09-17. It is a standalone Python tool that only
+# understands gcloud's *user* and *service-account-key* credentials: it cannot use the
+# external-account (federated) credential Workload Identity Federation issues, so every call fails
+# under WIF while the identical `gcloud storage` call works — it is the same gcloud binary that
+# performed the token exchange. Every release path here runs on WIF now. Do not reintroduce it.
+command -v gcloud >/dev/null 2>&1 || {
+ echo "error: gcloud not found — install/authenticate the gcloud SDK" >&2
exit 1
-fi
+}
+gcloud storage --help >/dev/null 2>&1 || {
+ echo "error: this gcloud is too old for 'gcloud storage' — update the gcloud SDK" >&2
+ exit 1
+}
[ -f "$SCRIPT" ] || { echo "error: $SCRIPT not found" >&2; exit 1; }
sh -n "$SCRIPT" # fail before uploading a script that doesn't even parse
@@ -41,11 +45,7 @@ CC="no-cache, no-store, must-revalidate"
CT="text/x-shellscript; charset=utf-8"
echo ">> uploading $SCRIPT"
echo " -> gs://${GCS_BUCKET}/${GCS_PATH}"
-if [ "$GCS_CLI" = gcloud ]; then
- gcloud storage cp --cache-control="$CC" --content-type="$CT" "$SCRIPT" "gs://${GCS_BUCKET}/${GCS_PATH}"
-else
- gsutil -h "Cache-Control:$CC" -h "Content-Type:$CT" cp "$SCRIPT" "gs://${GCS_BUCKET}/${GCS_PATH}"
-fi
+gcloud storage cp --cache-control="$CC" --content-type="$CT" "$SCRIPT" "gs://${GCS_BUCKET}/${GCS_PATH}"
echo ""
echo ">> published: ${CDN_URL}"
diff --git a/desktop/RELEASE.md b/desktop/RELEASE.md
index ce42eeb07..018d6e424 100644
--- a/desktop/RELEASE.md
+++ b/desktop/RELEASE.md
@@ -359,7 +359,7 @@ page, and in its summary — named `Harness-macos[-arm64]-<next version>-<commit
cannot be found by guessing. The run page that prints its link is public, though, so anyone who
opens it can download the build. The team chose that on 2026-09-10 over a key-derived link that only
key holders could work out; if it stops being acceptable, that is the design to go back to.
-- Take a build back with `gsutil -m rm -r gs://s3-autonomous-upgrade-3/harness/desktop-internal/<token>`
+- Take a build back with `gcloud storage rm -r gs://s3-autonomous-upgrade-3/harness/desktop-internal/<token>`
(the summary prints it); the workflow strips the release's year-long cache headers from these files
so a deletion sticks.
- **It never updates itself.** `DESKTOP_UPDATE_METADATA_URL` points at a manifest nothing writes,
diff --git a/desktop/scripts/publish-managed-node-runtime.sh b/desktop/scripts/publish-managed-node-runtime.sh
index 73bc49a16..bf574ea79 100644
--- a/desktop/scripts/publish-managed-node-runtime.sh
+++ b/desktop/scripts/publish-managed-node-runtime.sh
@@ -13,13 +13,22 @@ if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
exit 2
fi
-for command in curl gsutil shasum python3; do
+for command in curl shasum python3; do
command -v "$command" >/dev/null 2>&1 || {
echo "error: $command is required" >&2
exit 1
}
done
+# --- GCS client: `gcloud storage`, and only `gcloud storage` ---
+# gsutil was retired from this repo on 2026-09-17. It is a standalone Python tool that only
+# understands gcloud's *user* and *service-account-key* credentials: it cannot use the
+# external-account (federated) credential Workload Identity Federation issues, so every call fails
+# under WIF while the identical `gcloud storage` call works — it is the same gcloud binary that
+# performed the token exchange. Do not reintroduce it.
+command -v gcloud >/dev/null 2>&1 || { echo "error: gcloud not found — install/authenticate the gcloud SDK" >&2; exit 1; }
+gcloud storage --help >/dev/null 2>&1 || { echo "error: this gcloud is too old for 'gcloud storage' — update the gcloud SDK" >&2; exit 1; }
+
GCS_BUCKET="${GCS_BUCKET:-s3-autonomous-upgrade-3}"
PUBLIC_BASE="${GCS_PUBLIC_BASE_URL:-https://storage.googleapis.com/${GCS_BUCKET}}"
METADATA_PATH="${METADATA_PATH:-harness/runtime/metadata.json}"
@@ -56,12 +65,12 @@ for pair in \
url="${PUBLIC_BASE%/}/${object_path}"
size="$(wc -c < "$archive_path" | tr -d ' ')"
echo ">> uploading $archive ($size bytes)"
- gsutil -h 'Cache-Control:public, max-age=31536000, immutable' cp \
+ gcloud storage cp --cache-control='public, max-age=31536000, immutable' \
"$archive_path" "gs://${GCS_BUCKET}/${object_path}"
ENTRIES+=("$manifest_arch|v$VERSION|$url|$actual|$size|node-v${VERSION}-${platform}-${upstream_arch}")
done
-if ! gsutil cp "gs://${GCS_BUCKET}/${METADATA_PATH}" "$SRC" 2>/dev/null; then
+if ! gcloud storage cp "gs://${GCS_BUCKET}/${METADATA_PATH}" "$SRC" 2>/dev/null; then
printf '{}' > "$SRC"
fi
@@ -93,9 +102,9 @@ with open(dst, "w") as f:
f.write("\n")
PY
-gsutil -h 'Content-Type:application/json' \
- -h 'Cache-Control:no-cache, no-store, must-revalidate' \
- cp "$DST" "gs://${GCS_BUCKET}/${METADATA_PATH}"
+gcloud storage cp --content-type=application/json \
+ --cache-control='no-cache, no-store, must-revalidate' \
+ "$DST" "gs://${GCS_BUCKET}/${METADATA_PATH}"
echo ">> published managed Node v${VERSION}"
echo ">> manifest: ${PUBLIC_BASE%/}/${METADATA_PATH}"
diff --git a/desktop/scripts/publish-managed-tmux-runtime.sh b/desktop/scripts/publish-managed-tmux-runtime.sh
index 76b572e45..cf9be4929 100755
--- a/desktop/scripts/publish-managed-tmux-runtime.sh
+++ b/desktop/scripts/publish-managed-tmux-runtime.sh
@@ -19,13 +19,36 @@ if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+[a-z]?$ ]] || [[ -z "$ARCHIVES_DIR" ]]; the
fi
[[ -d "$ARCHIVES_DIR" ]] || { echo "error: $ARCHIVES_DIR is not a directory" >&2; exit 2; }
-for command in gsutil shasum python3; do
+for command in shasum python3; do
command -v "$command" >/dev/null 2>&1 || {
echo "error: $command is required" >&2
exit 1
}
done
+# --- GCS client: `gcloud storage`, and only `gcloud storage` ---
+# gsutil was retired from this repo on 2026-09-17. It is a standalone Python tool that only
+# understands gcloud's *user* and *service-account-key* credentials: it cannot use the
+# external-account (federated) credential Workload Identity Federation issues, so every call fails
+# under WIF while the identical `gcloud storage` call works — it is the same gcloud binary that
+# performed the token exchange. Every release path here runs on WIF now. Do not reintroduce it.
+command -v gcloud >/dev/null 2>&1 || {
+ echo "error: gcloud not found — install/authenticate the gcloud SDK" >&2
+ exit 1
+}
+gcloud storage --help >/dev/null 2>&1 || {
+ echo "error: this gcloud is too old for 'gcloud storage' — update the gcloud SDK" >&2
+ exit 1
+}
+
+# gcs_cp <src> <dst> [cache-control] [content-type] — either side may be gs:// or a local path or `-`.
+gcs_cp() {
+ local src="$1" dst="$2" cc="${3:-}" ct="${4:-}" args=(storage cp)
+ if [ -n "$cc" ]; then args+=("--cache-control=$cc"); fi
+ if [ -n "$ct" ]; then args+=("--content-type=$ct"); fi
+ gcloud "${args[@]}" "$src" "$dst"
+}
+
GCS_BUCKET="${GCS_BUCKET:-s3-autonomous-upgrade-3}"
PUBLIC_BASE="${GCS_PUBLIC_BASE_URL:-https://storage.googleapis.com/${GCS_BUCKET}}"
METADATA_PATH="${METADATA_PATH:-harness/runtime/tmux/metadata.json}"
@@ -55,11 +78,11 @@ for entry in "${ENTRIES[@]}"; do
IFS='|' read -r platform version archive sha256 size root <<< "$entry"
object_path="harness/runtime/tmux/v${version}/${archive}"
echo ">> uploading $archive ($size bytes, sha256 $sha256)"
- gsutil -h 'Cache-Control:public, max-age=31536000, immutable' cp \
- "$ARCHIVES_DIR/$archive" "gs://${GCS_BUCKET}/${object_path}"
+ gcs_cp "$ARCHIVES_DIR/$archive" "gs://${GCS_BUCKET}/${object_path}" \
+ 'public, max-age=31536000, immutable'
done
-if ! gsutil cp "gs://${GCS_BUCKET}/${METADATA_PATH}" "$SRC" 2>/dev/null; then
+if ! gcs_cp "gs://${GCS_BUCKET}/${METADATA_PATH}" "$SRC" 2>/dev/null; then
printf '{}' > "$SRC"
fi
@@ -91,9 +114,8 @@ with open(dst, "w") as f:
f.write("\n")
PY
-gsutil -h 'Content-Type:application/json' \
- -h 'Cache-Control:no-cache, no-store, must-revalidate' \
- cp "$DST" "gs://${GCS_BUCKET}/${METADATA_PATH}"
+gcs_cp "$DST" "gs://${GCS_BUCKET}/${METADATA_PATH}" \
+ 'no-cache, no-store, must-revalidate' 'application/json'
echo ">> published managed tmux ${VERSION}"
echo ">> manifest: ${PUBLIC_BASE%/}/${METADATA_PATH}"
diff --git a/desktop/scripts/upload-desktop-linux.sh b/desktop/scripts/upload-desktop-linux.sh
index 85edd581b..c2a83b4d8 100755
--- a/desktop/scripts/upload-desktop-linux.sh
+++ b/desktop/scripts/upload-desktop-linux.sh
@@ -26,10 +26,10 @@
# version.txt into the built bundle instead — read back by lib/core/app_version.dart at runtime and
# by lib/update/desktop_updater.dart's downloadAndStage() when verifying a downloaded update.
#
-# Prereqs: `gsutil` authenticated with WRITE access; the bucket/objects must be public-read;
-# `flutter` on PATH; must run on an actual Linux (Ubuntu) build host — `flutter build linux` cannot
-# cross-compile a Linux bundle from macOS or Windows. APPIMAGETOOL must point at an executable
-# `appimagetool-<x86_64|aarch64>.AppImage` — see release.yml for how CI fetches one.
+# Prereqs: `gcloud storage` authenticated with WRITE access; the bucket/objects must be
+# public-read; `flutter` on PATH; must run on an actual Linux (Ubuntu) build host — `flutter build
+# linux` cannot cross-compile a Linux bundle from macOS or Windows. APPIMAGETOOL must point at an
+# executable `appimagetool-<x86_64|aarch64>.AppImage` — see release.yml for how CI fetches one.
set -euo pipefail
set +x
@@ -118,7 +118,28 @@ if [ "$DO_BUILD" -eq 1 ] && [ "$RELEASE_ARCH" != "$HOST_ARCH" ]; then
echo " or use --no-build with an existing build/linux/${RELEASE_ARCH}/release/bundle." >&2
exit 1
fi
-command -v gsutil >/dev/null 2>&1 || { echo "error: gsutil not found — install/authenticate the gcloud SDK" >&2; exit 1; }
+# --- GCS client: `gcloud storage`, and only `gcloud storage` ---
+# gsutil was retired from this repo on 2026-09-17. It is a standalone Python tool that only
+# understands gcloud's *user* and *service-account-key* credentials: it cannot use the
+# external-account (federated) credential Workload Identity Federation issues, so every call fails
+# under WIF while the identical `gcloud storage` call works — it is the same gcloud binary that
+# performed the token exchange. Every release path here runs on WIF now. Do not reintroduce it.
+command -v gcloud >/dev/null 2>&1 || {
+ echo "error: gcloud not found — install/authenticate the gcloud SDK" >&2
+ exit 1
+}
+gcloud storage --help >/dev/null 2>&1 || {
+ echo "error: this gcloud is too old for 'gcloud storage' — update the gcloud SDK" >&2
+ exit 1
+}
+
+# gcs_cp <src> <dst> [cache-control] [content-type] — either side may be gs:// or a local path or `-`.
+gcs_cp() {
+ local src="$1" dst="$2" cc="${3:-}" ct="${4:-}" args=(storage cp)
+ if [ -n "$cc" ]; then args+=("--cache-control=$cc"); fi
+ if [ -n "$ct" ]; then args+=("--content-type=$ct"); fi
+ gcloud "${args[@]}" "$src" "$dst"
+}
command -v python3 >/dev/null 2>&1 || { echo "error: python3 not found" >&2; exit 1; }
command -v flutter >/dev/null 2>&1 || { echo "error: flutter not found" >&2; exit 1; }
command -v sha256sum >/dev/null 2>&1 || { echo "error: sha256sum not found" >&2; exit 1; }
@@ -215,11 +236,11 @@ echo ">> uploading release $VER ($SIZE bytes, sha256=$SHA)"
echo " dest: gs://${GCS_BUCKET}/${GCS_PATH}"
# Immutable per-version path — see the CDN_ASSET_BASE_URL note near the top of this script. Long
# max-age here is what actually lets the CDN cache it instead of hitting GCS on every install/update.
-gsutil -h "Cache-Control:public, max-age=31536000, immutable" cp "$OUTPUT" "gs://${GCS_BUCKET}/${GCS_PATH}"
+gcs_cp "$OUTPUT" "gs://${GCS_BUCKET}/${GCS_PATH}" "public, max-age=31536000, immutable"
echo ">> merging manifest: gs://${GCS_BUCKET}/${METADATA_PATH} (${OTA_KEY})"
SRC="$(mktemp)"; DST="$(mktemp)" # removed by cleanup() on EXIT
-if ! gsutil cp "gs://${GCS_BUCKET}/${METADATA_PATH}" "$SRC" 2>/dev/null; then
+if ! gcs_cp "gs://${GCS_BUCKET}/${METADATA_PATH}" "$SRC" 2>/dev/null; then
echo " (no existing metadata.json — creating a new one)"
printf '{}' > "$SRC"
fi
@@ -241,9 +262,8 @@ with open(dst, "w") as f:
json.dump(data, f, indent=2)
f.write("\n")
PY
-gsutil -h "Content-Type:application/json" \
- -h "Cache-Control:no-cache, no-store, must-revalidate" \
- cp "$DST" "gs://${GCS_BUCKET}/${METADATA_PATH}"
+gcs_cp "$DST" "gs://${GCS_BUCKET}/${METADATA_PATH}" \
+ "no-cache, no-store, must-revalidate" "application/json"
echo
echo ">> published desktop app (linux-${RELEASE_ARCH}) $VER"
diff --git a/desktop/scripts/upload-desktop.sh b/desktop/scripts/upload-desktop.sh
index 50ca53db2..9952996b2 100755
--- a/desktop/scripts/upload-desktop.sh
+++ b/desktop/scripts/upload-desktop.sh
@@ -19,7 +19,7 @@
# `--build-name`/`--build-number` flags, and this script asserts the artifact really carries it
# before publishing, so the running release always equals the published manifest version.
#
-# Prereqs: `gcloud storage` (or gsutil) authenticated with WRITE access on the bucket; the
+# Prereqs: `gcloud storage` authenticated with WRITE access on the bucket; the
# bucket/objects must be public-read;
# `flutter` on PATH; the Xcode project signs Release with a "Developer ID Application" identity
# (see macos/Runner.xcodeproj — CODE_SIGN_IDENTITY/DEVELOPMENT_TEAM) whose certificate + private key
@@ -117,36 +117,27 @@ fi
NOTARY_PROFILE="${NOTARY_PROFILE:-harness-notarize}"
-# --- GCS client: `gcloud storage` if we have it, else gsutil ---
-# gsutil is a standalone Python tool that only understands gcloud's *user* and *service-account-key*
-# credentials. It cannot use the external-account (federated) credential that Workload Identity
-# Federation issues, so a CI job authenticated by WIF fails on every gsutil call while the identical
-# `gcloud storage` call works — it is the same gcloud binary that performed the token exchange.
-# gsutil stays as the fallback for a laptop whose SDK predates `gcloud storage`.
-# Kept byte-identical to cli/scripts/upload-cli.sh — fix both together.
-if command -v gcloud >/dev/null 2>&1 && gcloud storage --help >/dev/null 2>&1; then
- GCS_CLI=gcloud
-elif command -v gsutil >/dev/null 2>&1; then
- GCS_CLI=gsutil
- echo ">> note: falling back to gsutil (no 'gcloud storage'); this will not work under workload identity federation" >&2
-else
- echo "error: neither 'gcloud storage' nor gsutil found — install/authenticate the gcloud SDK" >&2
+# --- GCS client: `gcloud storage`, and only `gcloud storage` ---
+# gsutil was retired from this repo on 2026-09-17. It is a standalone Python tool that only
+# understands gcloud's *user* and *service-account-key* credentials: it cannot use the
+# external-account (federated) credential Workload Identity Federation issues, so every call fails
+# under WIF while the identical `gcloud storage` call works — it is the same gcloud binary that
+# performed the token exchange. Every release path here runs on WIF now. Do not reintroduce it.
+command -v gcloud >/dev/null 2>&1 || {
+ echo "error: gcloud not found — install/authenticate the gcloud SDK" >&2
exit 1
-fi
+}
+gcloud storage --help >/dev/null 2>&1 || {
+ echo "error: this gcloud is too old for 'gcloud storage' — update the gcloud SDK" >&2
+ exit 1
+}
# gcs_cp <src> <dst> [cache-control] [content-type] — either side may be gs:// or a local path or `-`.
gcs_cp() {
- local src="$1" dst="$2" cc="${3:-}" ct="${4:-}" args=()
- if [ "$GCS_CLI" = gcloud ]; then
- args=(storage cp)
- if [ -n "$cc" ]; then args+=("--cache-control=$cc"); fi
- if [ -n "$ct" ]; then args+=("--content-type=$ct"); fi
- gcloud "${args[@]}" "$src" "$dst"
- else
- if [ -n "$cc" ]; then args+=(-h "Cache-Control:$cc"); fi
- if [ -n "$ct" ]; then args+=(-h "Content-Type:$ct"); fi
- gsutil "${args[@]}" cp "$src" "$dst"
- fi
+ local src="$1" dst="$2" cc="${3:-}" ct="${4:-}" args=(storage cp)
+ if [ -n "$cc" ]; then args+=("--cache-control=$cc"); fi
+ if [ -n "$ct" ]; then args+=("--content-type=$ct"); fi
+ gcloud "${args[@]}" "$src" "$dst"
}
command -v python3 >/dev/null 2>&1 || { echo "error: python3 not found" >&2; exit 1; }
command -v flutter >/dev/null 2>&1 || { echo "error: flutter not found" >&2; exit 1; }
diff --git a/device/harness/RELEASE.md b/device/harness/RELEASE.md
index b8ac8279d..9667e706d 100644
--- a/device/harness/RELEASE.md
+++ b/device/harness/RELEASE.md
@@ -59,7 +59,7 @@ commit + push** the `version.txt` bump). You can call the script directly too. I
from `IDF_PATH` or `~/esp/esp-idf`; if a step fails before publishing, it reverts the `version.txt`
bump so a failed run leaves no dangling version.
-**Publish prerequisites:** `gsutil` must be installed and authenticated (`gcloud auth login` /
+**Publish prerequisites:** `gcloud storage` must be installed and authenticated (`gcloud auth login` /
service account) with write access to the bucket, and the bucket/objects must be **public-read** so
devices can download without credentials.
diff --git a/device/harness/scripts/upload-firmware.sh b/device/harness/scripts/upload-firmware.sh
index e8568b285..86e06bfd2 100755
--- a/device/harness/scripts/upload-firmware.sh
+++ b/device/harness/scripts/upload-firmware.sh
@@ -15,7 +15,7 @@
# patch is bumped from there — the local version.txt is NOT committed/pushed (only written so the
# build can stamp the firmware). Steps: (1) resolve+bump version, (2) idf.py build, (3) upload .bin +
# merge metadata.json to GCS.
-# Prereqs: `gsutil` authenticated (gcloud auth) with WRITE access to the bucket; the bucket/objects
+# Prereqs: `gcloud storage` authenticated (gcloud auth) with WRITE access to the bucket; the bucket/objects
# must be public-read so devices can download without credentials. `idf.py` on PATH (or IDF_PATH set).
set -euo pipefail
@@ -64,7 +64,14 @@ for arg in "$@"; do
esac
done
-command -v gsutil >/dev/null 2>&1 || { echo "error: gsutil not found — install/authenticate the gcloud SDK" >&2; exit 1; }
+# --- GCS client: `gcloud storage`, and only `gcloud storage` ---
+# gsutil was retired from this repo on 2026-09-17. It is a standalone Python tool that only
+# understands gcloud's *user* and *service-account-key* credentials: it cannot use the
+# external-account (federated) credential Workload Identity Federation issues, so every call fails
+# under WIF while the identical `gcloud storage` call works — it is the same gcloud binary that
+# performed the token exchange. Do not reintroduce it.
+command -v gcloud >/dev/null 2>&1 || { echo "error: gcloud not found — install/authenticate the gcloud SDK" >&2; exit 1; }
+gcloud storage --help >/dev/null 2>&1 || { echo "error: this gcloud is too old for 'gcloud storage' — update the gcloud SDK" >&2; exit 1; }
# Restore version.txt (if we bumped it) and clean temp files when the release doesn't finish — so a
# failed run (e.g. build error) doesn't leave version.txt advanced with nothing published.
@@ -179,11 +186,11 @@ URL="${GCS_PUBLIC_BASE_URL%/}/${GCS_PATH#/}"
echo ">> uploading firmware $VER ($SIZE bytes, sha256=$SHA)"
echo " dest: gs://${GCS_BUCKET}/${GCS_PATH}"
-gsutil -h "Cache-Control:no-cache, no-store, must-revalidate" cp "$BIN" "gs://${GCS_BUCKET}/${GCS_PATH}"
+gcloud storage cp --cache-control="no-cache, no-store, must-revalidate" "$BIN" "gs://${GCS_BUCKET}/${GCS_PATH}"
echo ">> merging manifest: gs://${GCS_BUCKET}/${METADATA_PATH} (${OTA_KEY} = {version,url,sha256,size})"
SRC="$(mktemp)"; DST="$(mktemp)" # removed by cleanup() on EXIT
-if ! gsutil cp "gs://${GCS_BUCKET}/${METADATA_PATH}" "$SRC" 2>/dev/null; then
+if ! gcloud storage cp "gs://${GCS_BUCKET}/${METADATA_PATH}" "$SRC" 2>/dev/null; then
echo " (no existing metadata.json — creating a new one)"
printf '{}' > "$SRC"
fi
@@ -205,9 +212,9 @@ with open(dst, "w") as f:
json.dump(data, f, indent=2)
f.write("\n")
PY
-gsutil -h "Content-Type:application/json" \
- -h "Cache-Control:no-cache, no-store, must-revalidate" \
- cp "$DST" "gs://${GCS_BUCKET}/${METADATA_PATH}"
+gcloud storage cp --content-type=application/json \
+ --cache-control="no-cache, no-store, must-revalidate" \
+ "$DST" "gs://${GCS_BUCKET}/${METADATA_PATH}"
PUBLISHED=1 # release completed — cleanup() must NOT revert version.txt
# The version is tracked by the remote metadata.json (single source of truth) — we do NOT git-commit
diff --git a/device/harness/scripts/upload-flasher.sh b/device/harness/scripts/upload-flasher.sh
index a0753e000..742ed8393 100644
--- a/device/harness/scripts/upload-flasher.sh
+++ b/device/harness/scripts/upload-flasher.sh
@@ -13,7 +13,7 @@
# harness.autonomous.ai/flash-circle.sh and ships with a web deploy (same as /cli/install.sh). Nothing in
# this script touches metadata.json, so a mirror refresh can never disturb the fleet's OTA manifest.
#
-# Prereqs: an authenticated `gsutil` with write access (objects must be public-read), plus curl.
+# Prereqs: an authenticated `gcloud storage` with write access (objects must be public-read), plus curl.
# Published layout: harness/flasher/esptool/<ver>/<asset> (+ <asset>.sha256)
set -euo pipefail
@@ -37,7 +37,14 @@ done
command -v curl >/dev/null 2>&1 || { echo "error: curl is required" >&2; exit 1; }
[ -f "$FLASHER" ] || { echo "error: flasher not found at $FLASHER" >&2; exit 1; }
-[ "$DRY" -eq 1 ] || command -v gsutil >/dev/null 2>&1 || { echo "error: gsutil not found — install/authenticate the gcloud SDK" >&2; exit 1; }
+# --- GCS client: `gcloud storage`, and only `gcloud storage` ---
+# gsutil was retired from this repo on 2026-09-17. It is a standalone Python tool that only
+# understands gcloud's *user* and *service-account-key* credentials: it cannot use the
+# external-account (federated) credential Workload Identity Federation issues, so every call fails
+# under WIF while the identical `gcloud storage` call works — it is the same gcloud binary that
+# performed the token exchange. Do not reintroduce it.
+[ "$DRY" -eq 1 ] || command -v gcloud >/dev/null 2>&1 || { echo "error: gcloud not found — install/authenticate the gcloud SDK" >&2; exit 1; }
+[ "$DRY" -eq 1 ] || gcloud storage --help >/dev/null 2>&1 || { echo "error: this gcloud is too old for 'gcloud storage' — update the gcloud SDK" >&2; exit 1; }
sha256_of() {
if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | awk '{print $1}'
@@ -70,8 +77,8 @@ for asset in \
"
dest="gs://${GCS_BUCKET}/${FLASHER_PREFIX}/esptool/${ESPTOOL_VER}/${asset}"
echo " ↑ $dest"
- run gsutil -q cp "$TMP/$asset" "$dest"
- run gsutil -q cp "$TMP/$asset.sha256" "${dest}.sha256"
+ run gcloud storage cp --quiet "$TMP/$asset" "$dest"
+ run gcloud storage cp --quiet "$TMP/$asset.sha256" "${dest}.sha256"
done
echo ""