Skip to content

Commit da93a78

Browse files
authored
chore: manage tool versions via mise (#7513)
We currently pin Node in two files (`.nvmrc` and `.node-version`) that can drift, Maestro sits separately in `.tool-versions`, and Ruby needs a manual rbenv/rvm setup of its own. Following on from #7511, the natural cleanup is to give mise full responsibility for tool versions. This change makes `mise install` the single setup step: * Maestro moves into `mise.toml` * `.nvmrc` is removed in favor of keeping only `.node-version` (see below why we can't use `mise.toml` just yet for Node) * Node and Ruby are wired in through mise's idiomatic version file support. They stay pinned in `.node-version`/`.ruby-version` since the CI actions `actions/setup-node` and `ruby/setup-ruby` don't support Mise yet * For Bitrise the community [`nvm@1`](https://github.com/almouro/bitrise-nvm-step) step, which silently falls back to installing the latest Node once `.nvmrc` is gone, is replaced with a script step that installs mise and Node from the same `.node-version` pin and exposes them to all subsequent steps. Once [actions/setup-node#1421](actions/setup-node#1421) ships we can fold the Node pin into `mise.toml` and drop `.node-version` for a single canonical pin file.
1 parent 0d5e194 commit da93a78

9 files changed

Lines changed: 62 additions & 48 deletions

File tree

.github/workflows/android-e2e.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ jobs:
123123
124124
- name: Install Maestro
125125
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
126+
with:
127+
install_args: maestro
126128

127129
- name: Install Anvil
128130
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0

.github/workflows/ios-e2e.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ jobs:
8686
8787
- name: Install Maestro
8888
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
89+
with:
90+
install_args: maestro
8991

9092
- name: Install Anvil
9193
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.tool-versions

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,11 @@
1919
2020
### Prerequisites
2121

22-
1. Install nvm: https://github.com/creationix/nvm
23-
2. Install the required Node.js version: `nvm install`
24-
3. Install Ruby (version specified in `.ruby-version`). macOS system Ruby is
25-
too old and will not work. Use a version manager such as
26-
[rbenv](https://github.com/rbenv/rbenv) or [rvm](https://rvm.io/).
27-
4. Enable yarn: `corepack enable`
28-
29-
**Note:** On future terminal sessions, run `nvm use` to activate the correct
30-
Node.js version. Alternatively, set up
31-
[automatic nvm switching](https://github.com/nvm-sh/nvm#deeper-shell-integration)
32-
in your shell.
22+
1. Install [mise](https://mise.jdx.dev): `curl https://mise.run | sh`. See the
23+
[installation docs](https://mise.jdx.dev/getting-started.html) for shell
24+
activation (required so tool versions auto-switch when you `cd` into the repo).
25+
2. From the repo root: `mise install`. This installs all pinned tools.
26+
3. Enable yarn: `corepack enable`
3327

3428
### Internal developers
3529

@@ -119,7 +113,7 @@ patched by the postinstall script from `GOOGLE_SERVICE_API_KEY` in your `.env`.
119113
open -a "Android Studio" # macOS
120114
```
121115
Always launch Android Studio this way so it inherits your shell PATH
122-
(including `node` from nvm). Launching from Spotlight or the Dock will
116+
(including `node` from mise). Launching from Spotlight or the Dock will
123117
cause Gradle sync to fail with "Cannot run program node".
124118

125119
## Developing

bitrise.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,35 @@ workflows:
3333
build_setup:
3434
steps:
3535
- git-clone@8.1: {}
36-
- nvm@1: {}
36+
- script@1:
37+
inputs:
38+
- content: |-
39+
#!/usr/bin/env bash
40+
# fail if any commands fails
41+
set -e
42+
# debug log
43+
set -x
44+
45+
# Install mise from a pinned, checksum-verified release artifact instead of
46+
# piping https://mise.run into a shell. The Bitrise jobs hold signing credentials,
47+
# so we don't want to execute arbitrary scripts served by a mutable endpoint.
48+
MISE_VERSION="v2026.7.7"
49+
# sha256 of mise-${MISE_VERSION}-macos-arm64.tar.gz from the release's SHASUMS256.txt
50+
MISE_SHA256="df490dc2fff51c82bf0f64e1fcd0265b145ce80d2d15ce99b95f2adf0b1fe82c"
51+
52+
curl -fsSL "https://github.com/jdx/mise/releases/download/${MISE_VERSION}/mise-${MISE_VERSION}-macos-arm64.tar.gz" -o /tmp/mise.tar.gz
53+
echo "${MISE_SHA256} /tmp/mise.tar.gz" | shasum -a 256 -c -
54+
tar -xzf /tmp/mise.tar.gz -C /tmp
55+
mkdir -p "$HOME/.local/bin"
56+
mv /tmp/mise/bin/mise "$HOME/.local/bin/mise"
57+
58+
export PATH="$HOME/.local/bin:$PATH"
59+
mise trust
60+
mise install node
61+
62+
# Expose mise and its shims (node etc.) to all subsequent steps
63+
envman add --key PATH --value "$HOME/.local/share/mise/shims:$PATH"
64+
title: Install Node via mise
3765
- script@1:
3866
inputs:
3967
- content: |-

e2e/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22

33
### Setup
44

5-
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.
5+
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.
66

7-
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.
8-
2. From the repo root: `mise install` -- installs the pinned Maestro version (and any other tools added to `.tool-versions` over time).
9-
10-
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.
7+
To upgrade Maestro across the team, update the version in `mise.toml`.
118

129
### Run tests locally
1310

ios/.xcode.env

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,23 @@
22
# running script phases inside Xcode. For local-only overrides, create an
33
# `.xcode.env.local` (gitignored) -- it is sourced after this file and wins.
44
#
5-
# NODE_BINARY must point at the Node version this project pins (.node-version /
6-
# .nvmrc) so Xcode GUI builds use the same Node as the CLI and CI.
5+
# NODE_BINARY must point at the Node version this project pins (.node-version)
6+
# so Xcode GUI builds use the same Node as the CLI and CI.
77
#
88
# Why this logic exists: Xcode runs build phases in a minimal, non-login shell
9-
# that does NOT load your shell rc files, so version managers (mise/nvm) aren't
10-
# auto-activated and a bare `command -v node` can resolve to the wrong Node
11-
# (e.g. a Homebrew install) or none at all. We probe known version managers
12-
# first, then fall back to whatever `node` is on PATH, e.g. in CI where node is
13-
# usually on the path.
9+
# that does NOT load your shell rc files, so mise isn't auto-activated and a
10+
# bare `command -v node` can resolve to the wrong Node (e.g. a Homebrew
11+
# install) or none at all. We probe mise first, then fall back to whatever
12+
# `node` is on PATH, e.g. in CI where node is usually on the path.
1413

1514
__resolve_node_binary() {
16-
local mise_bin resolved nvm_sh
15+
local mise_bin resolved
1716

18-
# 1) mise -- resolves Node from the repo's mise config (mise.toml/.tool-versions),
19-
# or from .node-version/.nvmrc only when idiomatic version files are enabled.
20-
# Probe absolute paths too, since mise is often not on Xcode's stripped PATH:
21-
# the official curl installer lands in ~/.local/bin, Homebrew in /opt/homebrew
22-
# (Apple Silicon) or /usr/local (Intel).
17+
# 1) mise -- resolves Node from the repo pin (.node-version, read via the
18+
# idiomatic version file setting in mise.toml). Probe absolute paths too,
19+
# since mise is often not on Xcode's stripped PATH: the official curl
20+
# installer lands in ~/.local/bin, Homebrew in /opt/homebrew (Apple Silicon)
21+
# or /usr/local (Intel).
2322
for mise_bin in \
2423
"$(command -v mise 2>/dev/null)" \
2524
"$HOME/.local/bin/mise" \
@@ -31,21 +30,7 @@ __resolve_node_binary() {
3130
fi
3231
done
3332

34-
# 2) nvm -- source it and honor .nvmrc when present. Probe absolute Homebrew
35-
# paths too, since `brew` itself may not be on Xcode's stripped PATH.
36-
for nvm_sh in \
37-
"$HOME/.nvm/nvm.sh" \
38-
/opt/homebrew/opt/nvm/nvm.sh \
39-
/usr/local/opt/nvm/nvm.sh \
40-
"$(brew --prefix nvm 2>/dev/null)/nvm.sh"; do
41-
if [ -s "$nvm_sh" ]; then
42-
. "$nvm_sh" --no-use
43-
nvm use >/dev/null 2>&1 || nvm use default >/dev/null 2>&1
44-
break
45-
fi
46-
done
47-
48-
# 3) fall back to whatever Node is on PATH (correct in CI and plain installs).
33+
# 2) fall back to whatever Node is on PATH (correct in CI and plain installs).
4934
# `|| true` keeps an empty result from aborting `set -e` consumers (e.g.
5035
# expo-configure-project.sh) before they reach their own node-not-found path.
5136
command -v node 2>/dev/null || true

mise.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[tools]
2+
maestro = "cli-2.0.10"
3+
4+
[settings]
5+
# Node and Ruby stay pinned in .node-version/.ruby-version so actions/setup-node
6+
# and ruby/setup-ruby can read them. Node can fold into [tools] once
7+
# https://github.com/actions/setup-node/pull/1421 ships.
8+
idiomatic_version_file_enable_tools = ["node", "ruby"]

0 commit comments

Comments
 (0)