File tree Expand file tree Collapse file tree 4 files changed +9
-46
lines changed
Expand file tree Collapse file tree 4 files changed +9
-46
lines changed Original file line number Diff line number Diff line change 4242 run : |
4343 git submodule update --init --recursive
4444 shell : bash
45- - uses : actions/checkout@v5
46- if : steps.cache.outputs.cache-hit != 'true'
47- with :
48- repository : floooh/sokol-tools-bin
49- ref : " a06f19929ff8f9824ec6dd87c21329b1f205809e"
50- path : sokol-tools-bin
51- fetch-depth : 1
52- - name : Setup sokol-shdc
53- if : steps.cache.outputs.cache-hit != 'true'
54- shell : bash
55- run : |
56- if [[ "$RUNNER_OS" == "Windows" ]]; then
57- TARGET_DIR="C:/Windows/System32"
58- SHDC_BINARY="sokol-shdc.exe"
59- FIND_PATH="bin/win32"
60- elif [[ "$RUNNER_OS" == "macOS" ]]; then
61- TARGET_DIR="/usr/local/bin"
62- SHDC_BINARY="sokol-shdc"
63- FIND_PATH="bin/osx_arm64"
64- else # Linux
65- TARGET_DIR="/usr/local/bin"
66- SHDC_BINARY="sokol-shdc"
67- FIND_PATH="bin/linux"
68- fi
69- echo "Setting up sokol-tools from sokol-tools-bin/$FIND_PATH"
70- find sokol-tools-bin/$FIND_PATH -name $SHDC_BINARY -exec cp {} $TARGET_DIR \;
71- $SHDC_BINARY -h
7245 - uses : yuchanns/actions-luamake@v1
7346 if : steps.cache.outputs.cache-hit != 'true'
7447 with :
Original file line number Diff line number Diff line change 11local lm = require " luamake"
22local fs = require " bee.filesystem"
33
4- local shdc <const> = lm .shdc or " "
4+ local paths = {
5+ windows = " $PATH/win32/$NAME.exe" ,
6+ macos = " $PATH/osx_arm64/$NAME" ,
7+ linux = " $PATH/linux/$NAME" ,
8+ }
9+ local shdc = assert (paths [lm .os ]):gsub (" %$(%u+)" , {
10+ PATH = tostring (lm .basedir / " bin/sokol-tools-bin/bin" ),
11+ NAME = " sokol-shdc" ,
12+ })
513
614local function compile_shader (src , name , lang )
715 local dep = name .. " _shader"
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ if ok then
1919 local output = process .stdout :read " a"
2020 commit = output :match " ^%s*(.-)%s*$"
2121 process :wait ()
22- print (" Hash version: " .. commit )
2322 end
2423end
2524
Original file line number Diff line number Diff line change 11local subprocess = require " bee.subprocess"
2- local platform = require " bee.platform"
32local shdcexe , src , target , lang = ...
43
5- local function find_executable (name )
6- local handle = io.popen (" where " .. name .. " 2>nul" )
7- if handle then
8- local path = handle :read (" *line" )
9- local success = handle :close ()
10- if success and path and path ~= " " then
11- return path :gsub (" %s+$" , " " )
12- end
13- end
14- return name
15- end
16-
17- if shdcexe == " " then
18- shdcexe = platform .os == " windows" and find_executable (" sokol-shdc.exe" ) or " sokol-shdc"
19- end
20-
214local process = assert (subprocess .spawn {
225 shdcexe ,
236 " --input" ,
You can’t perform that action at this time.
0 commit comments