浏览代码

CI: Add detection of runner debug mode

PatTheMav 3 年之前
父节点
当前提交
e1f97fbe8c

+ 12 - 1
.github/actions/build-plugin/action.yml

@@ -39,6 +39,7 @@ runs:
         )
 
         if [[ '${{ inputs.codesign }}' == 'true' ]] build_args+=(-s)
+        if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug)
 
         ${{ inputs.workingDirectory }}/.github/scripts/build-macos.zsh ${build_args}
 
@@ -51,7 +52,11 @@ runs:
           -t linux-${{ inputs.target }}
         )
 
-        ${{ inputs.workingDirectory }}/.github/scripts/build-linux.sh ${build_args[@]}
+        if [[ -n "${CI}" && -n "${RUNNER_DEBUG}" ]]; then
+          build_args+=(--debug)
+        fi
+
+        ${{ inputs.workingDirectory }}/.github/scripts/build-linux.sh "${build_args[@]}"
 
     - name: Run Windows Build
       if: ${{ runner.os == 'Windows' }}
@@ -63,4 +68,10 @@ runs:
           CMakeGenerator = '${{ inputs.visualStudio }}'
         }
 
+        if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) {
+          $BuildArgs += @{
+            Debug = $true
+          }
+        }
+
         ${{ inputs.workingDirectory }}/.github/scripts/Build-Windows.ps1 @BuildArgs

+ 11 - 1
.github/actions/package-plugin/action.yml

@@ -59,6 +59,7 @@ runs:
 
         if [[ '${{ inputs.codesign }}' == 'true' ]] package_args+=(-s)
         if [[ '${{ inputs.notarize }}' == 'true' ]] package_args+=(-n)
+        if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug)
 
         ${{ inputs.workingDirectory }}/.github/scripts/package-macos.zsh ${package_args}
 
@@ -70,8 +71,11 @@ runs:
           -c ${{ inputs.config }}
           -t linux-${{ inputs.target }}
         )
+        if [[ -n "${CI}" && -n "${RUNNER_DEBUG}" ]]; then
+          build_args+=(--debug)
+        fi
 
-        ${{ inputs.workingDirectory }}/.github/scripts/package-linux.sh ${package_args[@]}
+        ${{ inputs.workingDirectory }}/.github/scripts/package-linux.sh "${package_args[@]}"
 
     - name: Run Windows packaging
       if: ${{ runner.os == 'Windows' }}
@@ -86,4 +90,10 @@ runs:
           $PackageArgs += @{BuildInstaller = $true}
         }
 
+        if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) {
+          $BuildArgs += @{
+            Debug = $true
+          }
+        }
+
         ${{ inputs.workingDirectory }}/.github/scripts/Package-Windows.ps1 @PackageArgs

+ 1 - 0
.github/scripts/.build.zsh

@@ -111,6 +111,7 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
       -v|--verbose) (( _verbosity += 1 )); shift ;;
       -h|--help) log_output ${_usage}; exit 0 ;;
       -V|--version) print -Pr "${_version}"; exit 0 ;;
+      --debug) _verbosity=3; shift ;;
       *) log_error "Unknown option: %B${1}%b"; log_output ${_usage}; exit 2 ;;
     }
   }

+ 1 - 0
.github/scripts/.package.zsh

@@ -113,6 +113,7 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
       -v|--verbose) (( _verbosity += 1 )); shift ;;
       -h|--help) log_output ${_usage}; exit 0 ;;
       -V|--version) print -Pr "${_version}"; exit 0 ;;
+      --debug) _verbosity=3; shift ;;
       *) log_error "Unknown option: %B${1}%b"; log_output ${_usage}; exit 2 ;;
     }
   }