From 37b4417ba878e41f5386213da71d8b52f72ff98a Mon Sep 17 00:00:00 2001 From: Yuki Iwanaga Date: Mon, 20 May 2024 19:29:00 +0900 Subject: [PATCH] Tweak --- .github/workflows/provisioning.yml | 10 ++++++--- provision | 36 +++++++++++++++--------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/.github/workflows/provisioning.yml b/.github/workflows/provisioning.yml index 2bb16655..1b1331dd 100644 --- a/.github/workflows/provisioning.yml +++ b/.github/workflows/provisioning.yml @@ -17,10 +17,14 @@ jobs: fail-fast: false matrix: include: - - tags: base,install.homebrew.tap,install.homebrew.formula - - tags: base,lang - - tags: install,app,system + - name: fundamental + tags: base,install.homebrew.tap,install.homebrew.formula + - name: language support + tags: base,lang + - name: apps and system + tags: install,app,system skip_tags: install.homebrew.formula + name: ${{ matrix.name }} steps: - uses: actions/checkout@v2 diff --git a/provision b/provision index 325e09b5..93d7e4e5 100755 --- a/provision +++ b/provision @@ -68,12 +68,7 @@ clone_or_update_repo() { fi } -load_envs() { - export ANYENV_INIT_CACHE_DISABLED=1 - source "$DOTFILES_PATH/shell/profile" -} - -check_xcode_license_approved() { +accept_xcode_license() { echo 'Agreeing to Xcode license...' if ! [[ "$(/usr/bin/xcrun clang 2>&1 || true)" =~ 'license' ]]; then @@ -85,6 +80,21 @@ check_xcode_license_approved() { echo 'done' } +install_rosetta2() { + echo 'Installing Rosetta 2...' + if [ -d /usr/libexec/rosetta ]; then + echo 'skip (already installed)' + return + fi + sudo softwareupdate --install-rosetta --agree-to-license + echo 'done' +} + +load_envs() { + export ANYENV_INIT_CACHE_DISABLED=1 + source "$DOTFILES_PATH/shell/profile" +} + install_homebrew() { command -v 'brew' > /dev/null 2>&1 && return @@ -110,16 +120,6 @@ install_ansible() { echo 'done' } -install_rosetta2() { - echo 'Installing Rosetta 2...' - if [ -d /usr/libexec/rosetta ]; then - echo 'skip (already installed)' - return - fi - sudo softwareupdate --install-rosetta --agree-to-license - echo 'done' -} - run_provisioning() { echo 'Provisioning...' @@ -149,13 +149,13 @@ main() { print_header check_os clone_or_update_repo - check_xcode_license_approved + accept_xcode_license + install_rosetta2 load_envs install_homebrew install_python3 install_ansible - install_rosetta2 run_provisioning "$@" }