diff --git a/.circleci/default_config.yml b/.circleci/default_config.yml index 9ca895ca46..2b07de632e 100644 --- a/.circleci/default_config.yml +++ b/.circleci/default_config.yml @@ -1,7 +1,7 @@ orbs: macos: circleci/macos@2.5.1 slack: circleci/slack@5.0.0 - revenuecat: revenuecat/sdks-common-config@4.1.0 + revenuecat: revenuecat/sdks-common-config@4.5.1 # Disabled until compatible with M1: codecov: codecov/codecov@3.3.0 # codecov: codecov/codecov@3.3.0 @@ -155,6 +155,7 @@ commands: template: basic_fail_1 install-bundle-dependencies: + description: "Runs bundle install. Assumes ruby is already on PATH (see install-mise-tools: tools: ruby in callers)." parameters: directory: type: string @@ -167,19 +168,9 @@ commands: echo "macOS version: $(cat .macos_version)" - restore_cache: keys: - # This cache key should be updated whenever we change the Ruby version - - v4-gem-cache-{{ checksum "Gemfile.lock" }}-{{ arch }}-macos-{{ checksum ".macos_version" }}-ruby-3.2.0 - # CircleCI images fail on Ruby 3.3 - # https://github.com/fastlane/fastlane/issues/21794#issuecomment-2021331335 - # Also, not using macos/switch-ruby because its broken - - run: - # We're using Ruby 3.2.0 here to avoid an issue that caused a crash with Fastlane and Ruby 3.2.2. - name: Set Ruby 3.2.0 - command: | - eval "$(rbenv init -)" - rbenv install -s 3.2.0 # Replace with your required Ruby version - rbenv global 3.2.0 - rbenv rehash + # Bump this key whenever the Ruby version or provider changes: native gem extensions + # link against a specific libruby path (v5 = rbenv -> mise migration). + - v5-gem-cache-{{ checksum "Gemfile.lock" }}-{{ arch }}-macos-{{ checksum ".macos_version" }}-ruby-3.2.0 - run: name: Verify Ruby version command: ruby -v @@ -192,10 +183,9 @@ commands: bundle install - save_cache: # This cache key should be updated whenever we change the Ruby version - key: v4-gem-cache-{{ checksum "Gemfile.lock" }}-{{ arch }}-macos-{{ checksum ".macos_version" }}-ruby-3.2.0 + key: v5-gem-cache-{{ checksum "Gemfile.lock" }}-{{ arch }}-macos-{{ checksum ".macos_version" }}-ruby-3.2.0 paths: - vendor/bundle - - ~/.rbenv/versions/3.2.0 install-dependencies: parameters: @@ -209,31 +199,31 @@ commands: type: boolean default: false steps: + # Ruby 3.2.0 comes from mise (see mise.toml); pinned to avoid a Fastlane crash on 3.2.2 and Ruby 3.3. + # rbenv is deprecated here in favor of mise. + - revenuecat/install-mise-tools: + tools: ruby - install-bundle-dependencies: directory: << parameters.directory >> - - run: - name: Generate homebrew cache key - command: | - echo "xcbeautify:<< parameters.install_xcbeautify >>" > .homebrew-deps - echo "mint:<< parameters.install_mint >>" >> .homebrew-deps - - restore_cache: - keys: - - v2-homebrew-cache-{{ checksum ".homebrew-deps" }}-{{ arch }} - when: condition: << parameters.install_xcbeautify >> steps: - - install-brew-dependency: - dependency_name: "xcbeautify" + # xcbeautify (2.30.1) comes from mise (see mise.toml); replaces the deprecated brew install. + - revenuecat/install-mise-tools: + tools: xcbeautify - when: condition: << parameters.install_mint >> steps: + # Homebrew cache is now mint-only: xcbeautify moved to mise above. + - restore_cache: + keys: + - v3-homebrew-cache-mint-{{ arch }} - install-brew-dependency: dependency_name: "mint" - - save_cache: - key: v2-homebrew-cache-{{ checksum ".homebrew-deps" }}-{{ arch }} - paths: - - /opt/homebrew/Cellar/xcbeautify/ - - /Users/$USER/Library/Caches/Homebrew/ + - save_cache: + key: v3-homebrew-cache-mint-{{ arch }} + paths: + - /Users/$USER/Library/Caches/Homebrew/ install-brew-dependency: parameters: @@ -254,6 +244,7 @@ commands: environment: HOMEBREW_NO_INSTALL_CLEANUP: 1 + # Not on mise: mise.toml pins 2.30.1, which is not Xcode 14 compatible. Legacy Xcode 14 job only. install-xcbeautify-for-xcode14: description: "Installs xcbeautify 1.6.0 using Mint" steps: @@ -274,23 +265,10 @@ commands: - ~/.mint install-xcbeautify-for-xcode15: - description: "Installs xcbeautify 2.30.1 using Mint" + description: "Installs xcbeautify (2.30.1) via mise (see mise.toml)" steps: - - restore_cache: - keys: - - mint-xcbeautify-2.30.1-{{ arch }} - - run: - name: Install xcbeautify 2.30.1 using Mint - command: | - if which xcbeautify > /dev/null 2>&1; then - echo "xcbeautify already installed, skipping." - exit 0 - fi - mint install cpisciotta/xcbeautify@2.30.1 - - save_cache: - key: mint-xcbeautify-2.30.1-{{ arch }} - paths: - - ~/.mint + - revenuecat/install-mise-tools: + tools: xcbeautify install-xcodes-for-xcode14: description: "Installs the xcodes 2.0.3 prebuilt binary" @@ -562,16 +540,19 @@ commands: default: false description: "Whether to include test/dev dependencies when generating the workspace." steps: - - revenuecat/install-tuist + - revenuecat/install-mise-tools: + tools: tuist - run: name: Generate Tuist workspace command: | - export PATH="$HOME/.local/share/mise/shims:$PATH" export TUIST_INCLUDE_TEST_DEPENDENCIES=<< parameters.include_test_dependencies >> + # --skip-tools: tuist is already installed by install-mise-tools above; + # without it, `mise run` re-verifies every declared tool (ruby, xcbeautify, etc.) + # on every call. if [ -n "<< parameters.query >>" ]; then - tuist install && tuist generate << parameters.query >> --no-open + mise run --skip-tools tuist-install && tuist generate << parameters.query >> --no-open else - tuist install && tuist generate --no-open + mise run --skip-tools tuist-install && tuist generate --no-open fi create-snapshot-pr-if-needed: @@ -1588,9 +1569,10 @@ jobs: key: v2-gem-cache-{{ checksum "Gemfile.lock" }}-{{ arch }} paths: - vendor/bundle - - install-dependencies + - revenuecat/install-mise-tools: + tools: ruby,xcbeautify,tuist + - install-bundle-dependencies - update-spm-installation-commit - - revenuecat/install-tuist - run: name: Deployment checks command: bundle exec fastlane release_checks @@ -1619,6 +1601,8 @@ jobs: steps: - revenuecat/setup-git-credentials - checkout + - revenuecat/install-mise-tools: + tools: ruby - install-bundle-dependencies - run: name: Build docs @@ -1636,6 +1620,8 @@ jobs: steps: - revenuecat/setup-git-credentials - checkout + - revenuecat/install-mise-tools: + tools: ruby - install-bundle-dependencies - run: name: Build docs @@ -1661,6 +1647,8 @@ jobs: name: macos-executor steps: - checkout + - revenuecat/install-mise-tools: + tools: ruby - install-bundle-dependencies - revenuecat/trust-github-key - run: @@ -1673,6 +1661,8 @@ jobs: name: macos-executor steps: - checkout + - revenuecat/install-mise-tools: + tools: ruby - install-bundle-dependencies - revenuecat/trust-github-key - run: @@ -1879,15 +1869,14 @@ jobs: shell: /bin/bash --login -o pipefail steps: - checkout - - install-dependencies: - install_xcbeautify: false - - revenuecat/install-swiftlint + - revenuecat/install-mise-tools: + tools: ruby,swiftlint + - install-bundle-dependencies - run: command: mkdir -p fastlane/test_output/swiftlint - run: name: Run fastlane swiftlint lane command: | - export PATH="$HOME/.local/share/mise/shims:$PATH" bundle exec fastlane run swiftlint raise_if_swiftlint_error:true strict:true \ reporter:junit output_file:fastlane/test_output/swiftlint/junit.xml no_output_timeout: 5m @@ -1978,8 +1967,9 @@ jobs: - checkout - revenuecat/setup-git-credentials - revenuecat/trust-github-key - - install-dependencies - - revenuecat/install-tuist + - revenuecat/install-mise-tools: + tools: ruby,xcbeautify,tuist + - install-bundle-dependencies - run: name: Submit RCT Tester command: bundle exec fastlane deploy_rct_tester dry_run:<< parameters.dry_run >> diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 49d1d3c913..b060350ae2 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1698,7 +1698,7 @@ platform :ios do Dir.chdir(project_root) do tuist_binary = `which tuist 2>/dev/null`.strip if tuist_binary.empty? - UI.user_error!("tuist not found in PATH. Install it with `mise install` or run the `revenuecat/install-tuist` CI step.") + UI.user_error!("tuist not found in PATH. Install it with `mise install` or run the `revenuecat/install-mise-tools` CI step (tools: tuist).") end # Build environment variable exports for TUIST_ prefixed variables diff --git a/mise.lock b/mise.lock new file mode 100644 index 0000000000..170fec576c --- /dev/null +++ b/mise.lock @@ -0,0 +1,84 @@ +# @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html + +[[tools.ruby]] +version = "3.2.0" +backend = "core:ruby" + +[tools.ruby.options] +compile = "false" +precompiled_url = "jdx/ruby" +ruby_build_repo = "https://github.com/rbenv/ruby-build.git" +ruby_install = "false" + +[tools.ruby."platforms.linux-arm64"] +checksum = "sha256:daaa78e1360b2783f98deeceb677ad900f3a36c0ffa6e2b6b19090be77abc272" +url = "https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.0.tar.gz" + +[tools.ruby."platforms.linux-x64"] +checksum = "sha256:daaa78e1360b2783f98deeceb677ad900f3a36c0ffa6e2b6b19090be77abc272" +url = "https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.0.tar.gz" + +[tools.ruby."platforms.macos-arm64"] +checksum = "sha256:daaa78e1360b2783f98deeceb677ad900f3a36c0ffa6e2b6b19090be77abc272" +url = "https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.0.tar.gz" + +[tools.ruby."platforms.macos-x64"] +checksum = "sha256:daaa78e1360b2783f98deeceb677ad900f3a36c0ffa6e2b6b19090be77abc272" +url = "https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.0.tar.gz" + +[[tools.swiftlint]] +version = "0.62.2" +backend = "aqua:realm/SwiftLint" + +[tools.swiftlint."platforms.linux-arm64"] +checksum = "sha256:a90ea84be3675e787c5784e46dcb5d173a3bf0b35b4f4e9e455d7b8eb728947e" +url = "https://github.com/realm/SwiftLint/releases/download/0.62.2/swiftlint_linux_arm64.zip" +url_api = "https://api.github.com/repos/realm/SwiftLint/releases/assets/309770383" + +[tools.swiftlint."platforms.linux-x64"] +checksum = "sha256:d44e21c234cded72e1735abb32e8c641fadaf60270ef49ea6abf979a47a31deb" +url = "https://github.com/realm/SwiftLint/releases/download/0.62.2/swiftlint_linux_amd64.zip" +url_api = "https://api.github.com/repos/realm/SwiftLint/releases/assets/309770374" + +[tools.swiftlint."platforms.macos-arm64"] +checksum = "sha256:79625bece2716395d955d34a5993e6c948ef57d0256abe5538aaab82f2ad6b68" +url = "https://github.com/realm/SwiftLint/releases/download/0.62.2/portable_swiftlint.zip" +url_api = "https://api.github.com/repos/realm/SwiftLint/releases/assets/309770381" + +[tools.swiftlint."platforms.macos-x64"] +checksum = "sha256:79625bece2716395d955d34a5993e6c948ef57d0256abe5538aaab82f2ad6b68" +url = "https://github.com/realm/SwiftLint/releases/download/0.62.2/portable_swiftlint.zip" +url_api = "https://api.github.com/repos/realm/SwiftLint/releases/assets/309770381" + +[[tools.tuist]] +version = "4.48.2" +backend = "aqua:tuist/tuist" + +[tools.tuist."platforms.macos-arm64"] +checksum = "sha256:0f506c997429e84734fb9285e6f5c925dd1348339b98b73ca350398075c0fb52" +url = "https://github.com/tuist/tuist/releases/download/4.48.2/tuist.zip" +url_api = "https://api.github.com/repos/tuist/tuist/releases/assets/248866156" + +[tools.tuist."platforms.macos-x64"] +checksum = "sha256:0f506c997429e84734fb9285e6f5c925dd1348339b98b73ca350398075c0fb52" +url = "https://github.com/tuist/tuist/releases/download/4.48.2/tuist.zip" +url_api = "https://api.github.com/repos/tuist/tuist/releases/assets/248866156" + +[[tools.xcbeautify]] +version = "2.30.1" +backend = "aqua:cpisciotta/xcbeautify" + +[tools.xcbeautify."platforms.linux-x64"] +checksum = "sha256:9d9ad531d34cefbcb76095dda31083d3509e9df8b1427acb09d43babd2ef75a5" +url = "https://github.com/cpisciotta/xcbeautify/releases/download/2.30.1/xcbeautify-2.30.1-x86_64-unknown-linux-gnu.tar.xz" +url_api = "https://api.github.com/repos/cpisciotta/xcbeautify/releases/assets/281202797" + +[tools.xcbeautify."platforms.macos-arm64"] +checksum = "sha256:2f7f4f8ef2776d1b390885f3c09d0a1447051b366aa05cf03ddd6c8c1aeddbbc" +url = "https://github.com/cpisciotta/xcbeautify/releases/download/2.30.1/xcbeautify-2.30.1-arm64-apple-macosx.zip" +url_api = "https://api.github.com/repos/cpisciotta/xcbeautify/releases/assets/281203184" + +[tools.xcbeautify."platforms.macos-x64"] +checksum = "sha256:e90c7a81fe0c9db216254fca75ad93079d1d52715836b8e6d812bafcf5446077" +url = "https://github.com/cpisciotta/xcbeautify/releases/download/2.30.1/xcbeautify-2.30.1-x86_64-apple-macosx.zip" +url_api = "https://api.github.com/repos/cpisciotta/xcbeautify/releases/assets/281203181" diff --git a/mise.toml b/mise.toml index c2f0b3030e..d8d53309f5 100644 --- a/mise.toml +++ b/mise.toml @@ -1,18 +1,26 @@ +[settings] +lockfile = true + +[settings.ruby] +compile = false + [tools] tuist = "4.48.2" swiftlint = "0.62.2" +ruby = "3.2.0" +xcbeautify = "2.30.1" [hooks] -postinstall = "mise run install" +postinstall = { task = "tuist-install" } -[tasks.install] +[tasks.tuist-install] description = "Resolve Swift Package dependencies via Tuist" run = "tuist install" # Shell setup task (no automated test); verified manually via `mise run setup-worktree`. [tasks.setup-worktree] description = "Prepare a git worktree: link Local.xcconfig from the primary checkout and resolve deps. Run `tuist generate ` afterwards." -depends = ["install"] +depends = ["tuist-install"] run = """ #!/usr/bin/env bash set -euo pipefail