diff --git a/Dockerfile b/Dockerfile index 4a271b9..9875c5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM cwtools/cwtools-action:latest +FROM volgakurvar/cwtools-action:1.0.0-dotnet COPY lib /action/lib diff --git a/lib/cwtools.rb b/lib/cwtools.rb index f30120d..f1eee37 100644 --- a/lib/cwtools.rb +++ b/lib/cwtools.rb @@ -42,6 +42,7 @@ @CHANGED_ONLY = ENV["INPUT_CHANGEDFILESONLY"] @CACHE_FULL = ENV["INPUT_CACHE"] @VANILLA_MODE = ENV["INPUT_VANILLAMODE"] +@CACHE_FILE_NAME = ENV["CACHE_FILE_NAME"] if @CW_CI_ENV == "github" @CHANGED_ONLY = !(@CHANGED_ONLY == '0' || @CHANGED_ONLY == '') @@ -192,8 +193,8 @@ def run_cwtools `cwtools --game #{(@GAME == "stellaris") ? "stl" : @GAME} --directory "#{@CW_WORKSPACE}#{@MOD_PATH}" --cachefile "/#{(@GAME == "stellaris") ? "stl" : @GAME}.cwv.bz2" --rulespath "/src/cwtools-#{@GAME}-config" validate --cachetype metadata --reporttype json --scope mods --outputfile output.json --languages #{@LOC_LANGUAGES} all` else $stderr.puts "Full cache mode..." - $stderr.puts "cwtools --game #{(@GAME == "stellaris") ? "stl" : @GAME} --directory \"#{@CW_WORKSPACE}#{@MOD_PATH}\" --cachefile \"/#{(@GAME == "stellaris") ? "stl" : @GAME}.cwb.bz2\" --rulespath \"/src/cwtools-#{@GAME}-config\" validate --cachetype full --reporttype json --scope mods --outputfile output.json --languages #{@LOC_LANGUAGES} all" - `cwtools --game #{(@GAME == "stellaris") ? "stl" : @GAME} --directory "#{@CW_WORKSPACE}#{@MOD_PATH}" --cachefile "/#{(@GAME == "stellaris") ? "stl" : @GAME}.cwb.bz2" --rulespath "/src/cwtools-#{@GAME}-config" validate --cachetype full --reporttype json --scope mods --outputfile output.json --languages #{@LOC_LANGUAGES} all` + $stderr.puts "cwtools --game #{(@GAME == "stellaris") ? "stl" : @GAME} --directory \"#{@CW_WORKSPACE}#{@MOD_PATH}\" --cachefile \"/#{@CACHE_FILE_NAME}\" --rulespath \"/src/cwtools-#{@GAME}-config\" validate --cachetype full --reporttype json --scope mods --outputfile output.json --languages #{@LOC_LANGUAGES} all" + `cwtools --game #{(@GAME == "stellaris") ? "stl" : @GAME} --directory "#{@CW_WORKSPACE}#{@MOD_PATH}" --cachefile "/#{@CACHE_FILE_NAME}" --rulespath "/src/cwtools-#{@GAME}-config" validate --cachetype full --reporttype json --scope mods --outputfile output.json --languages #{@LOC_LANGUAGES} all` end errors = JSON.parse(`cat output.json`) end diff --git a/lib/entrypoint.sh b/lib/entrypoint.sh index 960ef05..e30e4b4 100755 --- a/lib/entrypoint.sh +++ b/lib/entrypoint.sh @@ -90,10 +90,10 @@ if [ -z "$INPUT_VANILLAMODE" ] || [ "$INPUT_VANILLAMODE" = "" ] || [ "$INPUT_VAN mv -v cwtools-cache-files/$CWB_GAME.cwv.bz2 . else echo "Using full game cache from '$CW_WORKSPACE/$INPUT_CACHE'..." - mv -v $CW_WORKSPACE/$INPUT_CACHE . + mv -v $CW_WORKSPACE/$INPUT_CACHE /$CACHE_FILE_NAME - if [ ! -f "$CWB_GAME.cwb.bz2" ]; then - echo "$CWB_GAME.cwb.bz2 does not exist!" + if [ ! -f "$CACHE_FILE_NAME" ]; then + echo "$CACHE_FILE_NAME does not exist!" exit 1 fi fi