Skip to content

Commit 6e1fff2

Browse files
authored
Fix for older macos sdks (#4)
* testing for old macos sdks * autodetect dmg installer * fix inputs * fix inputs * fix test -d * fix if/fi * add macOS preflight check * fix use-cache => cache typo * bump version * add quiet option for latest notice * update readme
1 parent 0b1db49 commit 6e1fff2

File tree

4 files changed

+51
-15
lines changed

4 files changed

+51
-15
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,27 @@ on:
77
description: 'Enable additional CI tests'
88
required: false
99
default: false
10-
version:
11-
description: 'Vulkan SDK Version'
10+
versions:
11+
description: 'Vulkan SDK Versions'
1212
required: true
13-
default: '1.3.204.0'
13+
default: '[ "1.3.204.0" ]'
14+
oses:
15+
description: 'Matrix OSes'
16+
required: true
17+
default: '[ "ubuntu-latest", "windows-latest", "macos-latest" ]'
1418
jobs:
1519
setup-all-matrix:
1620
if: ${{ github.event.inputs.extra_tests == 'true' || github.event.inputs.extra_tests == 'matrix' }}
1721
strategy:
1822
matrix:
19-
os: [ ubuntu-latest, windows-latest, macos-latest ]
23+
os: ${{ fromJSON(github.event.inputs.oses) }}
24+
version: ${{ fromJSON(github.event.inputs.versions) }}
2025
runs-on: ${{ matrix.os }}
2126
steps:
2227
- uses: actions/checkout@v2
2328
- uses: ./
2429
with:
25-
version: ${{ github.event.inputs.version }}
30+
version: ${{ matrix.version }}
2631
cache: true
2732
- name: Test Vulkan SDK Install
2833
shell: bash
@@ -41,7 +46,7 @@ jobs:
4146
- uses: actions/checkout@v2
4247
- uses: ./
4348
with:
44-
version: 1.2.198.1
49+
version: ${{ fromJSON(github.event.inputs.versions)[0] }}
4550
cache: false
4651
- name: Smoke test Vulkan SDK
4752
shell: bash
@@ -74,7 +79,7 @@ jobs:
7479
- uses: actions/checkout@v2
7580
- uses: ./
7681
with:
77-
version: 1.2.198.1
82+
version: ${{ fromJSON(github.event.inputs.versions)[0] }}
7883
cache: false
7984
- name: Smoke test Vulkan SDK
8085
shell: bash
@@ -103,10 +108,20 @@ jobs:
103108
runs-on: macos-latest
104109
steps:
105110
- uses: actions/checkout@v2
111+
- name: Setup tmate session
112+
if: ${{ contains(github.event.inputs.extra_tests, 'tmate-before') }}
113+
uses: mxschmitt/[email protected]
114+
with:
115+
limit-access-to-actor: true
106116
- uses: ./
107117
with:
108-
version: 1.2.198.1
118+
version: ${{ fromJSON(github.event.inputs.versions)[0] }}
109119
cache: false
120+
- name: Setup tmate session
121+
if: ${{ contains(github.event.inputs.extra_tests, 'tmate-after') }}
122+
uses: mxschmitt/[email protected]
123+
with:
124+
limit-access-to-actor: true
110125
- name: Smoke test Vulkan SDK
111126
shell: bash
112127
run: |

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# install-vulkan-sdk v1.1
1+
# install-vulkan-sdk v1.1.1
22

33
[![test install-vulkan-sdk](https://github.com/humbletim/install-vulkan-sdk/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/humbletim/install-vulkan-sdk/actions/workflows/ci.yml)
44

@@ -8,7 +8,7 @@ This action automatically downloads and installs the Vulkan SDK development envi
88

99
```yaml
1010
-name: Install Vulkan SDK
11-
uses: humbletim/[email protected]
11+
uses: humbletim/[email protected].1
1212
with:
1313
version: 1.3.204.0
1414
cache: true
@@ -17,6 +17,7 @@ This action automatically downloads and installs the Vulkan SDK development envi
1717
Parameters:
1818
- *version* (required): `N.N.N.N` style Vulkan SDK release number (or `latest` to use most recent official release).
1919
- *cache* (optional; default=false): boolean indicating whether to cache the downloaded installer file between builds.
20+
- *quiet* (optional; default=false): when using `latest` an Annotation is added to builds with actual SDK number; set `quiet: true` to silence.
2021

2122
### SDK Revisions
2223

@@ -26,6 +27,12 @@ Several recent SDK releases (known to have installers available for all three wi
2627
- 1.2.198.1
2728
- 1.3.204.0
2829

30+
##### Tested SDK versions (as of 2022.02.26):
31+
- <sub><sup>[windows.json](https://vulkan.lunarg.com/sdk/versions/windows.json): 1.3.204.0 / 1.2.198.1 / 1.2.189.2 / 1.2.189.0 / 1.2.182.0 / 1.2.176.1 / 1.2.170.0 / 1.2.162.1 / 1.2.162.0 / 1.2.154.1 / 1.2.148.1 / 1.2.148.0</sup></sub>
32+
- <sub><sup>[linux.json](https://vulkan.lunarg.com/sdk/versions/linux.json): 1.3.204.0 / 1.2.198.1 / 1.2.189.0 / 1.2.182.0 / 1.2.176.1 / 1.2.170.0 / 1.2.162.1 / 1.2.162.0 / 1.2.148.1 / 1.2.148.0</sup></sub>
33+
- <sub><sup>[mac.json](https://vulkan.lunarg.com/sdk/versions/mac.json): 1.3.204.0 / 1.2.198.1 / 1.2.189.0 / 1.2.182.0 / 1.2.176.1 / 1.2.170.0 / 1.2.162.1 / 1.2.162.0 / 1.2.148.1 / 1.2.148.0</sup></sub>
34+
</sup></sub>
35+
2936
Additional release numbers can be found at https://vulkan.lunarg.com/sdk/home.
3037

3138
### Environment

action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ inputs:
1212
description: 'whether to cache the downloaded vulkan_sdk.* installer file (using github actions/cache)'
1313
default: false
1414
required: false
15+
quiet:
16+
description: 'silence GitHub Annotation notice displayed if resolving `latest` into Vulkan SDK release number'
17+
default: false
18+
required: false
1519
runs:
1620
using: "composite"
1721
steps:
@@ -33,8 +37,9 @@ runs:
3337
if [[ $version == 'latest' ]] ; then
3438
url=https://vulkan.lunarg.com/sdk/latest/$os.txt
3539
echo "note: resolving '$version' for '$os' via webservices lookup: $url" >&2
36-
version=$(curl -sL https://vulkan.lunarg.com/sdk/latest/$os.txt)
40+
version=$(curl -sL $url)
3741
test -n "$version" || { echo "could not resolve latest version" ; exit 9 ; }
42+
[[ "${{ inputs.quiet }}" == "true" ]] || echo "::notice title=Using Vulkan SDK $version::resolved via '$url'"
3843
fi
3944
(
4045
echo VULKAN_SDK=$sdk_dir
@@ -44,7 +49,7 @@ runs:
4449
4550
- name: Check Vulkan SDK installer cache
4651
id: vulkan-cached-sdk
47-
if: inputs.use-cache != 'false'
52+
if: inputs.cache != 'false'
4853
uses: actions/cache@v2
4954
with:
5055
path: vulkan_sdk.*

vulkan_prebuilt_helpers.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,19 @@ function install_mac() {
5858
echo "could not mount dmg image: vulkan_sdk.exe (mountpoint=$mountpoint)" >&2
5959
exit 7
6060
fi
61-
local sdk_temp=$VULKAN_SDK.tmp
62-
sudo $mountpoint/InstallVulkan.app/Contents/MacOS/InstallVulkan --root "$sdk_temp" --accept-licenses --default-answer --confirm-command install
61+
local sdk_temp=$mountpoint
62+
# > Vulkan SDK 1.2.170.0 .dmgs have an installer
63+
if [[ -d $mountpoint/InstallVulkan.app ]] ; then
64+
sdk_temp=$VULKAN_SDK.tmp
65+
sudo $mountpoint/InstallVulkan.app/Contents/MacOS/InstallVulkan --root "$sdk_temp" --accept-licenses --default-answer --confirm-command install
66+
else
67+
true # <= 1.2.170.0 .dmgs are just packaged folders
68+
fi
6369
du -hs $sdk_temp
70+
test -d $sdk_temp/macOS || { echo "unrecognized dmg folder layout: $sdk_temp" ; ls -l $sdk_temp ; exit 10 ; }
6471
cp -r $sdk_temp/macOS/* $VULKAN_SDK/
72+
if [[ -d $mountpoint/InstallVulkan.app ]] ; then
73+
sudo rm -rf "$sdk_temp"
74+
fi
6575
hdiutil detach $mountpoint
66-
sudo rm -rf "$sdk_temp"
6776
}

0 commit comments

Comments
 (0)