diff --git a/.github/workflows/shell-tests.yml b/.github/workflows/shell-tests.yml index b7b10ac13..ddcfdb72d 100644 --- a/.github/workflows/shell-tests.yml +++ b/.github/workflows/shell-tests.yml @@ -151,29 +151,29 @@ jobs: run: | - name: Find and Extract OpenNLP Distribution run: | - # Find the first non-src .tar.gz file in the target directory - $TAR_FILE = Get-ChildItem -Path opennlp-distr/target -Filter "*.tar.gz" | Where-Object { $_.Name -notlike "*-src*" } | Select-Object -First 1 - - # Ensure we found a file - if (-not $TAR_FILE) { - Write-Error "Error: No matching tar.gz file found in opennlp-distr/target" - exit 1 - } - - # Extract the tar.gz file to the user profile directory - $Destination = "$env:USERPROFILE" - tar -xzf $TAR_FILE.FullName -C $Destination - - # Get the directory name of the extracted content (excluding the tar path) - $EXTRACTED_DIR = (tar -tf $TAR_FILE.FullName | Select-Object -First 1).Split('/')[0] - - # Set OPENNLP_HOME dynamically in the environment - $OPENNLP_HOME_PATH = "$env:USERPROFILE\$EXTRACTED_DIR" - Write-Host "OPENNLP_HOME=$OPENNLP_HOME_PATH" # Debugging - - # Set the environment variable for future steps - echo "OPENNLP_HOME=$OPENNLP_HOME_PATH" >> $GITHUB_ENV - echo "$OPENNLP_HOME_PATH\bin" >> $GITHUB_PATH + # Find the first non-src .tar.gz file in the target directory + $TAR_FILE = Get-ChildItem -Path opennlp-distr/target -Filter "*.tar.gz" | Where-Object { $_.Name -notlike "*-src*" } | Select-Object -First 1 + + # Ensure we found a file + if (-not $TAR_FILE) { + Write-Error "Error: No matching tar.gz file found in opennlp-distr/target" + exit 1 + } + + # Extract the tar.gz file to the user profile directory + $Destination = "$env:USERPROFILE" + tar -xzf $TAR_FILE.FullName -C $Destination + + # Get the directory name of the extracted content (excluding the tar path) + $EXTRACTED_DIR = (tar -tf $TAR_FILE.FullName | Select-Object -First 1).Split('/')[0] + + # Set OPENNLP_HOME dynamically in the environment + $OPENNLP_HOME_PATH = "$env:USERPROFILE\$EXTRACTED_DIR" + Write-Host "OPENNLP_HOME=$OPENNLP_HOME_PATH" # Debugging + + # Set the environment variable for future steps + echo "OPENNLP_HOME=$OPENNLP_HOME_PATH" >> $GITHUB_ENV + echo "$OPENNLP_HOME_PATH\bin" >> $GITHUB_PATH - name: Verify Extraction run: |