From 71da372d835f50abf1b1b77e98c9acfd9c0f882a Mon Sep 17 00:00:00 2001 From: jwinterm Date: Tue, 19 May 2026 07:50:02 -0400 Subject: [PATCH] CI: install Go + gomobile if missing (for BitBox Flutter iOS bindings) scripts/build_bitbox_flutter.sh invokes build_bindings.sh which calls gomobile to generate iOS bindings for the Go BitBox client. Without Go + gomobile on the Mac runner, that step fails with 'gomobile: command not found'. Adds an idempotent step: install Go via brew if missing, then 'go install golang.org/x/mobile/cmd/{gomobile,gobind}@latest' if missing. Self-hosted runner persists $GOPATH/bin between runs, so steady-state is zero-cost after the first install. Same conditional-install pattern as Flutter + CocoaPods. --- .github/workflows/build-ios-sim.yml | 23 ++++++++++++++++++++-- .github/workflows/build-ios-testflight.yml | 19 ++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ios-sim.yml b/.github/workflows/build-ios-sim.yml index b94c1f645..104627faa 100644 --- a/.github/workflows/build-ios-sim.yml +++ b/.github/workflows/build-ios-sim.yml @@ -62,11 +62,9 @@ jobs: pod --version exit 0 fi - # Prefer Homebrew on macOS — no sudo, installs into its own prefix. if command -v brew >/dev/null; then brew install cocoapods else - # Fallback: user-local gem install (no sudo). export GEM_HOME="$HOME/.gem" export PATH="$GEM_HOME/bin:$PATH" echo "GEM_HOME=$HOME/.gem" >> "$GITHUB_ENV" @@ -75,6 +73,27 @@ jobs: fi pod --version + - name: Install Go + gomobile (if missing) + run: | + if ! command -v go >/dev/null; then + if command -v brew >/dev/null; then + brew install go + else + echo "Go missing and brew not available"; exit 1 + fi + fi + go version + # Ensure $(go env GOPATH)/bin is on PATH for subsequent steps. + GOPATH=$(go env GOPATH) + echo "$GOPATH/bin" >> "$GITHUB_PATH" + export PATH="$PATH:$GOPATH/bin" + # gomobile + gobind are needed by scripts/build_bitbox_flutter.sh + if ! command -v gomobile >/dev/null; then + go install golang.org/x/mobile/cmd/gomobile@latest + go install golang.org/x/mobile/cmd/gobind@latest + fi + which gomobile && gomobile version || true + - name: Show toolchain run: | set -x diff --git a/.github/workflows/build-ios-testflight.yml b/.github/workflows/build-ios-testflight.yml index 4acd81922..27e818cdd 100644 --- a/.github/workflows/build-ios-testflight.yml +++ b/.github/workflows/build-ios-testflight.yml @@ -76,6 +76,25 @@ jobs: fi pod --version + - name: Install Go + gomobile (if missing) + run: | + if ! command -v go >/dev/null; then + if command -v brew >/dev/null; then + brew install go + else + echo "Go missing and brew not available"; exit 1 + fi + fi + go version + GOPATH=$(go env GOPATH) + echo "$GOPATH/bin" >> "$GITHUB_PATH" + export PATH="$PATH:$GOPATH/bin" + if ! command -v gomobile >/dev/null; then + go install golang.org/x/mobile/cmd/gomobile@latest + go install golang.org/x/mobile/cmd/gobind@latest + fi + which gomobile && gomobile version || true + - name: Show toolchain run: | set -x