diff --git a/.github/workflows/android-e2e.yml b/.github/workflows/android-e2e.yml index d91a583574d..d6eaeac1124 100644 --- a/.github/workflows/android-e2e.yml +++ b/.github/workflows/android-e2e.yml @@ -123,6 +123,8 @@ jobs: - name: Install Maestro uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1 + with: + install_args: maestro - name: Install Anvil uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0 diff --git a/.github/workflows/ios-e2e.yml b/.github/workflows/ios-e2e.yml index ac5b042fa6d..e540c58cd4a 100644 --- a/.github/workflows/ios-e2e.yml +++ b/.github/workflows/ios-e2e.yml @@ -86,6 +86,8 @@ jobs: - name: Install Maestro uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1 + with: + install_args: maestro - name: Install Anvil uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0 diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 53d1c14db37..00000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v22 diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index 775dc3aaa19..00000000000 --- a/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -maestro cli-2.0.10 diff --git a/README.md b/README.md index c20c9a0ec64..91d532363d5 100644 --- a/README.md +++ b/README.md @@ -19,17 +19,11 @@ ### Prerequisites -1. Install nvm: https://github.com/creationix/nvm -2. Install the required Node.js version: `nvm install` -3. Install Ruby (version specified in `.ruby-version`). macOS system Ruby is - too old and will not work. Use a version manager such as - [rbenv](https://github.com/rbenv/rbenv) or [rvm](https://rvm.io/). -4. Enable yarn: `corepack enable` - -**Note:** On future terminal sessions, run `nvm use` to activate the correct -Node.js version. Alternatively, set up -[automatic nvm switching](https://github.com/nvm-sh/nvm#deeper-shell-integration) -in your shell. +1. Install [mise](https://mise.jdx.dev): `curl https://mise.run | sh`. See the + [installation docs](https://mise.jdx.dev/getting-started.html) for shell + activation (required so tool versions auto-switch when you `cd` into the repo). +2. From the repo root: `mise install`. This installs all pinned tools. +3. Enable yarn: `corepack enable` ### Internal developers @@ -119,7 +113,7 @@ patched by the postinstall script from `GOOGLE_SERVICE_API_KEY` in your `.env`. open -a "Android Studio" # macOS ``` Always launch Android Studio this way so it inherits your shell PATH - (including `node` from nvm). Launching from Spotlight or the Dock will + (including `node` from mise). Launching from Spotlight or the Dock will cause Gradle sync to fail with "Cannot run program node". ## Developing diff --git a/bitrise.yml b/bitrise.yml index 110ebb3bfe9..62e9ffffdf6 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -33,7 +33,35 @@ workflows: build_setup: steps: - git-clone@8.1: {} - - nvm@1: {} + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # debug log + set -x + + # Install mise from a pinned, checksum-verified release artifact instead of + # piping https://mise.run into a shell. The Bitrise jobs hold signing credentials, + # so we don't want to execute arbitrary scripts served by a mutable endpoint. + MISE_VERSION="v2026.7.7" + # sha256 of mise-${MISE_VERSION}-macos-arm64.tar.gz from the release's SHASUMS256.txt + MISE_SHA256="df490dc2fff51c82bf0f64e1fcd0265b145ce80d2d15ce99b95f2adf0b1fe82c" + + curl -fsSL "https://github.com/jdx/mise/releases/download/${MISE_VERSION}/mise-${MISE_VERSION}-macos-arm64.tar.gz" -o /tmp/mise.tar.gz + echo "${MISE_SHA256} /tmp/mise.tar.gz" | shasum -a 256 -c - + tar -xzf /tmp/mise.tar.gz -C /tmp + mkdir -p "$HOME/.local/bin" + mv /tmp/mise/bin/mise "$HOME/.local/bin/mise" + + export PATH="$HOME/.local/bin:$PATH" + mise trust + mise install node + + # Expose mise and its shims (node etc.) to all subsequent steps + envman add --key PATH --value "$HOME/.local/share/mise/shims:$PATH" + title: Install Node via mise - script@1: inputs: - content: |- diff --git a/e2e/README.md b/e2e/README.md index c8cc97f591f..68e7b6e6f0d 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -2,12 +2,9 @@ ### Setup -The Maestro version used by this repo is pinned in `.tool-versions` at the repo root. Both CI and local installs read from that file. +The Maestro version used by this repo is pinned via mise. See the [repo README](../README.md#prerequisites) for the full setup. Both CI and local installs use the same pin. -1. Install [mise](https://mise.jdx.dev): `curl https://mise.run | sh` (or via your package manager). See the [installation docs](https://mise.jdx.dev/getting-started.html) for shell activation. -2. From the repo root: `mise install` -- installs the pinned Maestro version (and any other tools added to `.tool-versions` over time). - -To upgrade Maestro across the team, update the version in `.tool-versions` and open a PR. CI uses the same file, so everyone stays in sync. +To upgrade Maestro across the team, update the version in `mise.toml`. ### Run tests locally diff --git a/ios/.xcode.env b/ios/.xcode.env index fb7e76edc80..2b7e29184dd 100644 --- a/ios/.xcode.env +++ b/ios/.xcode.env @@ -2,24 +2,23 @@ # running script phases inside Xcode. For local-only overrides, create an # `.xcode.env.local` (gitignored) -- it is sourced after this file and wins. # -# NODE_BINARY must point at the Node version this project pins (.node-version / -# .nvmrc) so Xcode GUI builds use the same Node as the CLI and CI. +# NODE_BINARY must point at the Node version this project pins (.node-version) +# so Xcode GUI builds use the same Node as the CLI and CI. # # Why this logic exists: Xcode runs build phases in a minimal, non-login shell -# that does NOT load your shell rc files, so version managers (mise/nvm) aren't -# auto-activated and a bare `command -v node` can resolve to the wrong Node -# (e.g. a Homebrew install) or none at all. We probe known version managers -# first, then fall back to whatever `node` is on PATH, e.g. in CI where node is -# usually on the path. +# that does NOT load your shell rc files, so mise isn't auto-activated and a +# bare `command -v node` can resolve to the wrong Node (e.g. a Homebrew +# install) or none at all. We probe mise first, then fall back to whatever +# `node` is on PATH, e.g. in CI where node is usually on the path. __resolve_node_binary() { - local mise_bin resolved nvm_sh + local mise_bin resolved - # 1) mise -- resolves Node from the repo's mise config (mise.toml/.tool-versions), - # or from .node-version/.nvmrc only when idiomatic version files are enabled. - # Probe absolute paths too, since mise is often not on Xcode's stripped PATH: - # the official curl installer lands in ~/.local/bin, Homebrew in /opt/homebrew - # (Apple Silicon) or /usr/local (Intel). + # 1) mise -- resolves Node from the repo pin (.node-version, read via the + # idiomatic version file setting in mise.toml). Probe absolute paths too, + # since mise is often not on Xcode's stripped PATH: the official curl + # installer lands in ~/.local/bin, Homebrew in /opt/homebrew (Apple Silicon) + # or /usr/local (Intel). for mise_bin in \ "$(command -v mise 2>/dev/null)" \ "$HOME/.local/bin/mise" \ @@ -31,21 +30,7 @@ __resolve_node_binary() { fi done - # 2) nvm -- source it and honor .nvmrc when present. Probe absolute Homebrew - # paths too, since `brew` itself may not be on Xcode's stripped PATH. - for nvm_sh in \ - "$HOME/.nvm/nvm.sh" \ - /opt/homebrew/opt/nvm/nvm.sh \ - /usr/local/opt/nvm/nvm.sh \ - "$(brew --prefix nvm 2>/dev/null)/nvm.sh"; do - if [ -s "$nvm_sh" ]; then - . "$nvm_sh" --no-use - nvm use >/dev/null 2>&1 || nvm use default >/dev/null 2>&1 - break - fi - done - - # 3) fall back to whatever Node is on PATH (correct in CI and plain installs). + # 2) fall back to whatever Node is on PATH (correct in CI and plain installs). # `|| true` keeps an empty result from aborting `set -e` consumers (e.g. # expo-configure-project.sh) before they reach their own node-not-found path. command -v node 2>/dev/null || true diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000000..c4a44462026 --- /dev/null +++ b/mise.toml @@ -0,0 +1,8 @@ +[tools] +maestro = "cli-2.0.10" + +[settings] +# Node and Ruby stay pinned in .node-version/.ruby-version so actions/setup-node +# and ruby/setup-ruby can read them. Node can fold into [tools] once +# https://github.com/actions/setup-node/pull/1421 ships. +idiomatic_version_file_enable_tools = ["node", "ruby"]