From d9387ba0408bc8009b314b124f498ae90a39dc5f Mon Sep 17 00:00:00 2001 From: volgakurvar Date: Tue, 13 Sep 2022 22:29:07 +0900 Subject: [PATCH 1/7] =?UTF-8?q?=E3=81=84=E3=81=84=E3=81=8B=E3=82=93?= =?UTF-8?q?=E3=81=98=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cwtools.rb | 5 +++-- lib/entrypoint.sh | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) 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 From 145b2fbe7303a62473d10eeb1cf8e06a0a081ea0 Mon Sep 17 00:00:00 2001 From: volgakurvar Date: Tue, 13 Sep 2022 23:02:55 +0900 Subject: [PATCH 2/7] dotnet 6 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 3449a34db1b3a0ab16bde8eacc68e2ff41e57450 Mon Sep 17 00:00:00 2001 From: volgakurvar Date: Tue, 13 Sep 2022 23:22:09 +0900 Subject: [PATCH 3/7] =?UTF-8?q?=E3=81=8F=E3=81=8A=E3=83=BC=E3=81=A8?= =?UTF-8?q?=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cwtools.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cwtools.rb b/lib/cwtools.rb index f1eee37..e26b456 100644 --- a/lib/cwtools.rb +++ b/lib/cwtools.rb @@ -102,7 +102,7 @@ def get_changed_files Dir.chdir(@CW_WORKSPACE) do if @CW_CI_ENV == "github" if @is_pull_request - diff_output = `git log --name-only --pretty="" origin/#{@is_pull_request[0]}..origin/#{@is_pull_request[1]}` + diff_output = `git log --name-only --pretty="" "origin/#{@is_pull_request[0]}".."origin/#{@is_pull_request[1]}"` else before_commit = @event["before"] diff_output = `git diff --name-only #{before_commit} #{@CW_SHA}` From 7f5bb74072035a441dbc028939bc4cba17255c7d Mon Sep 17 00:00:00 2001 From: volgakurvar Date: Tue, 13 Sep 2022 23:33:55 +0900 Subject: [PATCH 4/7] =?UTF-8?q?=E3=83=89=E3=83=83=E3=83=88=E3=82=92?= =?UTF-8?q?=E4=B8=80=E3=81=A4=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cwtools.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cwtools.rb b/lib/cwtools.rb index e26b456..3117f03 100644 --- a/lib/cwtools.rb +++ b/lib/cwtools.rb @@ -102,7 +102,7 @@ def get_changed_files Dir.chdir(@CW_WORKSPACE) do if @CW_CI_ENV == "github" if @is_pull_request - diff_output = `git log --name-only --pretty="" "origin/#{@is_pull_request[0]}".."origin/#{@is_pull_request[1]}"` + diff_output = `git diff --name-only origin/#{@is_pull_request[0]}...origin/#{@is_pull_request[1]}` else before_commit = @event["before"] diff_output = `git diff --name-only #{before_commit} #{@CW_SHA}` From b16e4e20e364f8682cf32960a2d7dfc8dbdbe66e Mon Sep 17 00:00:00 2001 From: volgakurvar Date: Tue, 13 Sep 2022 23:48:15 +0900 Subject: [PATCH 5/7] =?UTF-8?q?=E3=81=8F=E3=81=9D=E3=82=84=E3=82=8D?= =?UTF-8?q?=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/entrypoint.sh b/lib/entrypoint.sh index e30e4b4..d86b6f0 100755 --- a/lib/entrypoint.sh +++ b/lib/entrypoint.sh @@ -100,6 +100,7 @@ if [ -z "$INPUT_VANILLAMODE" ] || [ "$INPUT_VANILLAMODE" = "" ] || [ "$INPUT_VAN else echo "Vanilla mode, not using cache..." fi +git branch -l ruby /action/lib/cwtools.rb if [ $CW_CI_ENV = "gitlab" ]; then From 3d38c54f07f5fef5277b9ac65c72959d57a68a7f Mon Sep 17 00:00:00 2001 From: volgakurvar Date: Tue, 13 Sep 2022 23:57:02 +0900 Subject: [PATCH 6/7] =?UTF-8?q?=E3=81=95=E3=83=BC=E3=81=9B=E3=82=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/entrypoint.sh b/lib/entrypoint.sh index d86b6f0..e30e4b4 100755 --- a/lib/entrypoint.sh +++ b/lib/entrypoint.sh @@ -100,7 +100,6 @@ if [ -z "$INPUT_VANILLAMODE" ] || [ "$INPUT_VANILLAMODE" = "" ] || [ "$INPUT_VAN else echo "Vanilla mode, not using cache..." fi -git branch -l ruby /action/lib/cwtools.rb if [ $CW_CI_ENV = "gitlab" ]; then From aa892bb123cc11ef9f841891c2a7ad1fd0fa44a8 Mon Sep 17 00:00:00 2001 From: volgakurvar Date: Wed, 14 Sep 2022 00:01:14 +0900 Subject: [PATCH 7/7] =?UTF-8?q?=E5=8B=95=E3=81=8D=E3=81=BE=E3=81=99?= =?UTF-8?q?=E3=81=8B=E3=81=AD=EF=BD=9E=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cwtools.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cwtools.rb b/lib/cwtools.rb index 3117f03..f1eee37 100644 --- a/lib/cwtools.rb +++ b/lib/cwtools.rb @@ -102,7 +102,7 @@ def get_changed_files Dir.chdir(@CW_WORKSPACE) do if @CW_CI_ENV == "github" if @is_pull_request - diff_output = `git diff --name-only origin/#{@is_pull_request[0]}...origin/#{@is_pull_request[1]}` + diff_output = `git log --name-only --pretty="" origin/#{@is_pull_request[0]}..origin/#{@is_pull_request[1]}` else before_commit = @event["before"] diff_output = `git diff --name-only #{before_commit} #{@CW_SHA}`