|
2 | 2 | set -euo pipefail |
3 | 3 | echo "The build architecture is ${ImageOS}" |
4 | 4 |
|
| 5 | +# macOS 15 runner setup (arm64 host). We support both: |
| 6 | +# - INTEL=true => x86_64 portable Ruby (Rosetta) + x86_64 Homebrew (/usr/local) |
| 7 | +# - INTEL=false => arm64 portable Ruby (native) + arm64 Homebrew (/opt/homebrew) |
| 8 | +INTEL="${INTEL:-false}" |
| 9 | + |
5 | 10 | if [ "${ImageOS}" == "ubuntu22" ] && [ "${BUILD_TYPE}" == "docker" ]; then |
6 | 11 | echo "Installing docker compose" |
7 | 12 | sudo rm -f /usr/local/bin/docker-compose |
|
19 | 24 | brew update > $GITHUB_WORKSPACE/spec/files/logs/brew-update.log |
20 | 25 | brew install pv tree coreutils shared-mime-info |
21 | 26 |
|
| 27 | + if [[ "${INTEL}" == "true" ]]; then |
| 28 | + echo "macos15 INTEL=true => x86_64 dependencies" |
| 29 | + OS_ARCH_SUFFIX="Darwin-x86_64" |
| 30 | + MONGO_ARCH="x86_64" |
| 31 | + RUBY_ARCH_TARBALL="ruby-3.2.2-darwin.tar.gz" |
| 32 | + else |
| 33 | + echo "macos15 INTEL=false => arm64 dependencies" |
| 34 | + OS_ARCH_SUFFIX="Darwin-arm64" |
| 35 | + MONGO_ARCH="arm64" |
| 36 | + RUBY_ARCH_TARBALL="ruby-3.2.2-darwin-arm64.tar.gz" |
| 37 | + fi |
| 38 | + |
22 | 39 | # install portable ruby - required for build that will eventually be published |
23 | 40 | # see https://github.com/NREL/OpenStudio-PAT/wiki/Pat-Build-Notes |
24 | | - curl -SLO --insecure https://openstudio-resources.s3.amazonaws.com/pat-dependencies3/ruby-3.2.2-darwin.tar.gz |
25 | | - tar xzf ruby-3.2.2-darwin.tar.gz |
| 41 | + # --- install portable ruby (arch-specific) --- |
| 42 | + # NOTE: you need these tarballs available in S3. If you only have ruby-3.2.2-darwin.tar.gz today, |
| 43 | + # you’ll need to publish per-arch names (recommended) or keep a conditional mapping. |
| 44 | + curl -SLO --insecure "https://openstudio-resources.s3.amazonaws.com/pat-dependencies3/${RUBY_ARCH_TARBALL}" |
| 45 | + tar xzf "${RUBY_ARCH_TARBALL}" |
26 | 46 | exit_status_tar=$? |
27 | 47 | if [ $exit_status_tar -ne 0 ]; then |
28 | | - echo "Error: Failed to extract Ruby 3.2.2 archive" |
29 | | - exit $exit_status_tar |
| 48 | + echo "Error: Failed to extract Ruby 3.2.2 archive" |
| 49 | + exit $exit_status_tar |
30 | 50 | fi |
| 51 | + sudo rm -rf /usr/local/ruby |
31 | 52 | sudo mv ruby /usr/local/ |
32 | 53 | otool -L /usr/local/ruby/bin/ruby |
33 | | - rm ruby-3.2.2-darwin.tar.gz |
| 54 | + rm "${RUBY_ARCH_TARBALL}" |
34 | 55 |
|
35 | | - # Install mongodb from a download. Brew is hanging and requires building mongo. This also speeds up the builds. |
36 | | - curl -SLO https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-6.0.7.tgz |
37 | | - tar xvzf mongodb-macos-x86_64-6.0.7.tgz |
| 56 | + # --- Install mongodb from a download (arch-specific) --- |
| 57 | + MONGO_TARBALL="mongodb-macos-${MONGO_ARCH}-6.0.7.tgz" |
| 58 | + curl -SLO "https://fastdl.mongodb.org/osx/${MONGO_TARBALL}" |
| 59 | + tar xvzf "${MONGO_TARBALL}" |
38 | 60 | exit_status_tar=$? |
39 | 61 | if [ $exit_status_tar -ne 0 ]; then |
40 | | - echo "Error: Failed to extract Mongo 6.0.7 archive" |
41 | | - exit $exit_status_tar |
| 62 | + echo "Error: Failed to extract Mongo 6.0.7 archive" |
| 63 | + exit $exit_status_tar |
42 | 64 | fi |
43 | | - sudo cp mongodb-macos-x86_64-6.0.7/bin/* /usr/local/bin/ |
44 | | - rm -r mongodb-macos* |
| 65 | + |
| 66 | + # The extracted folder name usually matches the tarball stem. |
| 67 | + # Using a glob keeps it simple across arch. |
| 68 | + sudo cp mongodb-macos-*/bin/* /usr/local/bin/ |
| 69 | + rm -rf mongodb-macos* |
45 | 70 |
|
46 | 71 | # Install openstudio -- Use the install script that is in this repo now, the one on OpenStudio/develop has changed |
47 | | - export OS_NAME=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64 |
48 | | - export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64 |
| 72 | + export OS_NAME="OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-${OS_ARCH_SUFFIX}" |
| 73 | + export OS_NAME_WITH_PLUS="$OS_NAME" |
| 74 | + #export OS_NAME=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64 |
| 75 | + #export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64 |
49 | 76 | #curl -SL --insecure https://openstudio-ci-builds.s3-us-west-2.amazonaws.com/develop/${OS_NAME}.tar.gz -o $OS_NAME_WITH_PLUS.tar.gz |
50 | 77 | #curl -SL --insecure https://github.com/NREL/OpenStudio/releases/download/v3.8.0/${OS_NAME}.tar.gz -o $OS_NAME_WITH_PLUS.tar.gz |
51 | 78 | #curl -SL --insecure https://github.com/NREL/OpenStudio/releases/download/v${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}/${OS_NAME}.tar.gz -o $OS_NAME_WITH_PLUS.tar.gz |
|
0 commit comments