Skip to content

Commit 83df043

Browse files
committed
Add GitHub Composite Action to install CMake on macOS runners
1 parent 655cc10 commit 83df043

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

.github/actions/build-swiftusd/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ inputs:
2929
runs:
3030
using: "composite"
3131
steps:
32+
33+
- name: Install CMake
34+
uses: ./.github/actions/install-cmake
3235

3336
- name: Clone OpenUSD
3437
uses: actions/checkout@v5
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#===----------------------------------------------------------------------===#
2+
# This source file is part of github.com/apple/SwiftUsd
3+
#
4+
# Copyright © 2025 Apple Inc. and the SwiftUsd project authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#===----------------------------------------------------------------------===#
20+
21+
# Installs CMake 3.26.5 for macOS
22+
23+
name: Install CMake
24+
25+
runs:
26+
using: "composite"
27+
steps:
28+
29+
- name: Download CMake
30+
run: |
31+
curl https://github.com/Kitware/CMake/releases/download/v3.26.5/cmake-3.26.5-macos-universal.dmg \
32+
--output CMake.dmg
33+
working-directory: ${{ runner.temp }}
34+
shell: bash
35+
36+
37+
- name: Verify SHA256 checksum
38+
run: |
39+
# Hard-coded checksum taken from https://github.com/Kitware/CMake/releases/download/v3.26.5/cmake-3.26.5-SHA-256.txt,
40+
# cmake-3.26.5-macos-universal.dmg
41+
echo '18fb759bbdd04309be6a8e12920a8183ebbb17b331a6b7fc6a4071a68e5c81fd *CMake.dmg' | shasum -a 256 -c
42+
working-directory: ${{ runner.temp }}
43+
shell: bash
44+
45+
46+
- name: Attach DMG
47+
run: hdiutil attach CMake.dmg
48+
working-directory: ${{ runner.temp }}
49+
shell: bash
50+
51+
- name: Copy app to permanent location
52+
run: |
53+
cp /Volumes/CMake/CMake.app ../CMake.app
54+
hdiutil detach /Volumes/CMake
55+
working-directory: ${{ github.workspace }
56+
shell: bash
57+
58+
- name: Add CMake to PATH
59+
run: |
60+
# Note: `export PATH=` doesn't work for GitHub actions, the environment variable
61+
# must be set by redirecting into GITHUB_ENV
62+
echo "PATH=$PATH:$GITHUB_WORKSPACE/../CMake.app/Contents/bin" >> $GITHUB_ENV
63+
shell: bash
64+
65+
- name: Test CMake is in PATH
66+
run: which cmake
67+
shell: bash

0 commit comments

Comments
 (0)