diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 570e65c..8045759 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -36,13 +36,11 @@ jobs: steps: - run: echo $env:PATH + - run: "ls env:" + - run: "ls variable:" - uses: actions/checkout@v4 - uses: ./ with: ref: ${{ github.head_ref }} - run: tgf --help-tgf - if: runner.os != 'Windows' - - - run: ./tgf --help-tgf - if: runner.os == 'Windows' diff --git a/action.yml b/action.yml index 02402a6..e4989cc 100644 --- a/action.yml +++ b/action.yml @@ -5,6 +5,7 @@ inputs: tgf-path: description: Installs the TGF binary to this folder. The folder will not be added to the PATH. required: false + default: ${{ runner.os == 'Windows' && '${env:LocalAppData}\Microsoft\WindowsApps' || '/usr/local/bin' }} ref: description: The ref to use to run the install script. default: ${{ github.action_ref }} @@ -29,4 +30,5 @@ runs: TGF_PATH: ${{ inputs.tgf-path }} VERSION: ${{ inputs.ref }} run: | + echo ${env:TGF_PATH} (Invoke-WebRequest https://raw.githubusercontent.com/coveooss/tgf/${env:VERSION}/get-latest-tgf.ps1).Content | Invoke-Expression diff --git a/get-latest-tgf.ps1 b/get-latest-tgf.ps1 index d24538f..84cc866 100644 --- a/get-latest-tgf.ps1 +++ b/get-latest-tgf.ps1 @@ -33,6 +33,8 @@ $TempTgfPath = Join-Path -Path $TempTgfFolder -ChildPath "tgf.exe" Write-Host "Installing tgf v$($LATEST_VERSION) in the current directory ($(Get-Location)) ..." Invoke-WebRequest "https://github.com/coveo/tgf/releases/download/v$($LATEST_VERSION)/tgf_$($LATEST_VERSION)_windows_64-bits.zip" -OutFile $ZipFile Expand-Archive -Path $ZipFile -DestinationPath $TempTgfFolder + +Write-Host "Copying executable to v$($TGF_PATH)" Copy-Item $TempTgfPath -Destination $TGF_PATH -Force Remove-Item $ZipFile