@@ -147,39 +147,38 @@ jobs:
147
147
- name : Build with Maven
148
148
run : mvn -V clean install --no-transfer-progress -Pci -DskipTests=true
149
149
150
- - name : Find and Extract OpenNLP Distribution
151
- run : |
152
150
- name : Find and Extract OpenNLP Distribution
153
151
run : |
154
152
# Find the first non-src .tar.gz file in the target directory
155
153
$TAR_FILE = Get-ChildItem -Path opennlp-distr/target -Filter "*.tar.gz" | Where-Object { $_.Name -notlike "*-src*" } | Select-Object -First 1
156
-
154
+
157
155
# Ensure we found a file
158
156
if (-not $TAR_FILE) {
159
157
Write-Error "Error: No matching tar.gz file found in opennlp-distr/target"
160
158
exit 1
161
159
}
162
-
163
- # Extract the tar.gz file to the user profile directory
164
- $Destination = "$env:USERPROFILE "
160
+
161
+ # Extract the tar.gz file to the current directory
162
+ $Destination = "$(pwd) "
165
163
tar -xzf $TAR_FILE.FullName -C $Destination
166
-
164
+
167
165
# Get the directory name of the extracted content (excluding the tar path)
168
166
$EXTRACTED_DIR = (tar -tf $TAR_FILE.FullName | Select-Object -First 1).Split('/')[0]
169
-
167
+
170
168
# Set OPENNLP_HOME dynamically in the environment
171
- $OPENNLP_HOME_PATH = "$env:USERPROFILE \$EXTRACTED_DIR"
169
+ $OPENNLP_HOME_PATH = "$Destination \$EXTRACTED_DIR"
172
170
Write-Host "OPENNLP_HOME=$OPENNLP_HOME_PATH" # Debugging
173
-
171
+
174
172
# Set the environment variable for future steps
175
173
echo "OPENNLP_HOME=$OPENNLP_HOME_PATH" >> $GITHUB_ENV
176
174
echo "$OPENNLP_HOME_PATH\bin" >> $GITHUB_PATH
175
+
177
176
178
177
- name : Verify Extraction
179
178
run : |
180
- # Print the OPENNLP_HOME and check if the 'bin' directory exists
181
- echo "OPENNLP_HOME: $env:OPENNLP_HOME"
182
- dir "$env:OPENNLP_HOME\bin"
179
+ # Print the OPENNLP_HOME and check if the 'bin' directory exists
180
+ echo "OPENNLP_HOME: $env:OPENNLP_HOME"
181
+ dir "$env:OPENNLP_HOME\bin"
183
182
184
183
- name : Run Pester Tests
185
184
run : |
0 commit comments