From 4fd1c2fa1753bd696650e37adca59f62067dd686 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Thu, 14 Sep 2023 17:11:06 -0500 Subject: [PATCH] love windows. --- action.yaml | 23 +++++++++++++---------- scripts/windowsish-17.ps1 | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/action.yaml b/action.yaml index 284e94c..f2ade5b 100644 --- a/action.yaml +++ b/action.yaml @@ -40,18 +40,21 @@ runs: echo "found=false" >> $GITHUB_OUTPUT fi - - name: 'Install jq - Unix-ish' - if: (runner.os == 'Linux' || runner.os == 'macOS') && (steps.jq-check-unix.outputs.found == 'false' || inputs.force == 'true') + - name: 'Install jq - Unix-ish non-1.7' + if: (runner.os == 'Linux' || runner.os == 'macOS') && (inputs.version == '1.5' || inputs.version == '1.6') (steps.jq-check-unix.outputs.found == 'false' || inputs.force == 'true') shell: bash env: JQ_VERSION: '${{ inputs.version }}' # language=sh - run: | - if [[ '${{ inputs.version }}' == '1.5' ]] || [[ '${{ inputs.version }}' == '1.6' ]]; then - $GITHUB_ACTION_PATH/scripts/unixish.sh - else - $GITHUB_ACTION_PATH/scripts/unixish-17.sh - fi + run: ${{ github.action_path }/scripts/unixish.sh + + - name: 'Install jq - Unix-ish 1.7' + if: (runner.os == 'Linux' || runner.os == 'macOS') && inputs.version == '1.7' (steps.jq-check-unix.outputs.found == 'false' || inputs.force == 'true') + shell: bash + env: + JQ_VERSION: '${{ inputs.version }}' + # language=sh + run: ${{ github.action_path }/scripts/unixish-17.sh - name: 'Check for jq - Windows-ish' id: jq-check-windows @@ -74,7 +77,7 @@ runs: env: JQ_VERSION: '${{ inputs.version }}' # language=powershell - run: .\scripts\windowsish.ps1 + run: ${{ github.action_path }\scripts\windowsish.ps1 - name: 'Install jq - Windows-ish 1.7' if: runner.os == 'Windows' && inputs.version == '1.7' && (steps.jq-check-windows.outputs.found == 'false' || inputs.force == 'true') @@ -82,4 +85,4 @@ runs: env: JQ_VERSION: '${{ inputs.version }}' # language=powershell - run: .\scripts\windowsish-17.ps1 + run: ${{ github.action_path }\scripts\windowsish-17.ps1 diff --git a/scripts/windowsish-17.ps1 b/scripts/windowsish-17.ps1 index 8079dee..fb037ee 100755 --- a/scripts/windowsish-17.ps1 +++ b/scripts/windowsish-17.ps1 @@ -34,7 +34,7 @@ switch ($_arch_env) } # build bin name -$_bin_name = "jq-windows-${_arch}" +$_bin_name = "jq-windows-${_arch}.exe" # build download vars