Skip to content

Commit 0b1db49

Browse files
authored
Merge pull request #2 from humbletim/add-support-for-latest
Add support for `version: latest`
2 parents 8d2a4a7 + f248b4c commit 0b1db49

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
description: 'Enable additional CI tests'
88
required: false
99
default: false
10+
version:
11+
description: 'Vulkan SDK Version'
12+
required: true
13+
default: '1.3.204.0'
1014
jobs:
1115
setup-all-matrix:
1216
if: ${{ github.event.inputs.extra_tests == 'true' || github.event.inputs.extra_tests == 'matrix' }}
@@ -18,7 +22,7 @@ jobs:
1822
- uses: actions/checkout@v2
1923
- uses: ./
2024
with:
21-
version: 1.3.204.0
25+
version: ${{ github.event.inputs.version }}
2226
cache: true
2327
- name: Test Vulkan SDK Install
2428
shell: bash

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# install-vulkan-sdk v1
1+
# install-vulkan-sdk v1.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,14 +8,14 @@ This action automatically downloads and installs the Vulkan SDK development envi
88

99
```yaml
1010
-name: Install Vulkan SDK
11-
uses: humbletim/install-vulkan-sdk@v1
11+
uses: humbletim/install-vulkan-sdk@v1.1
1212
with:
1313
version: 1.3.204.0
1414
cache: true
1515
```
1616
1717
Parameters:
18-
- *version* (required): N.N.N.N style Vulkan SDK release number.
18+
- *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.
2020

2121
### SDK Revisions

action.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,18 @@ runs:
2727
Windows|MINGW*) os=windows ; basedir=$(pwd -W) ;;
2828
*) echo "unknown runner_os: $runner_os" ; exit 7 ; ;;
2929
esac
30-
test -d $basedir/VULKAN_SDK || mkdir -v $basedir/VULKAN_SDK
30+
version=${VULKAN_SDK_VERSION:-${{ inputs.version }}}
31+
sdk_dir=${VULKAN_SDK:-$basedir/VULKAN_SDK}
32+
test -d $sdk_dir || mkdir -pv $sdk_dir
33+
if [[ $version == 'latest' ]] ; then
34+
url=https://vulkan.lunarg.com/sdk/latest/$os.txt
35+
echo "note: resolving '$version' for '$os' via webservices lookup: $url" >&2
36+
version=$(curl -sL https://vulkan.lunarg.com/sdk/latest/$os.txt)
37+
test -n "$version" || { echo "could not resolve latest version" ; exit 9 ; }
38+
fi
3139
(
32-
echo VULKAN_SDK=$basedir/VULKAN_SDK
33-
echo VULKAN_SDK_VERSION=${{ inputs.version }}
40+
echo VULKAN_SDK=$sdk_dir
41+
echo VULKAN_SDK_VERSION=$version
3442
echo VULKAN_SDK_PLATFORM=$os
3543
) | tee -a $GITHUB_ENV
3644
@@ -40,7 +48,7 @@ runs:
4048
uses: actions/cache@v2
4149
with:
4250
path: vulkan_sdk.*
43-
key: ${{ runner.os }}-vulkan-prebuilt-sdk-${{ inputs.cache }}-${{ inputs.version }}
51+
key: ${{ runner.os }}-vulkan-prebuilt-sdk-${{ inputs.cache }}-${{ env.VULKAN_SDK_VERSION }}
4452

4553
- name: Download Vulkan SDK
4654
shell: bash

0 commit comments

Comments
 (0)