Skip to content

Commit 499b624

Browse files
committed
ci: ensure mdbtools is actually in Windows path
1 parent aaad5c3 commit 499b624

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,29 @@ jobs:
104104
if: runner.os == 'Windows'
105105
run: |
106106
$url = "https://github.com/lsgunth/mdbtools-win/archive/refs/tags/v1.0.0.zip"
107-
$zipPath = "$env:RUNNER_TEMP\mdbtools-win.zip"
108-
$extractPath = "$env:GITHUB_WORKSPACE\path"
107+
$zipPath = "$env:RUNNER_TEMP\mdbtools-win-1.0.0.zip"
108+
$extractRoot = "$env:RUNNER_TEMP\mdbtools"
109+
$installPath = "$env:GITHUB_WORKSPACE\mdbtools"
109110
110111
# Download the zip file
111112
Invoke-WebRequest -Uri $url -OutFile $zipPath
112113
113-
# Create the target directory if it doesn't exist
114-
New-Item -ItemType Directory -Force -Path $extractPath | Out-Null
114+
# Create the extraction root and install directories
115+
New-Item -ItemType Directory -Force -Path $extractRoot | Out-Null
116+
New-Item -ItemType Directory -Force -Path $installPath | Out-Null
115117
116118
# Extract the zip file
117-
Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force
119+
Expand-Archive -Path $zipPath -DestinationPath $extractRoot -Force
118120
119-
Write-Host "Extracted to $extractPath"
121+
# Move contents from the subfolder (mdbtools-win-1.0.0) to install path
122+
$innerDir = Join-Path $extractRoot "mdbtools-win-1.0.0"
123+
Copy-Item -Path (Join-Path $innerDir "*") -Destination $installPath -Recurse -Force
124+
125+
# Add install path to PATH
126+
Write-Host "Adding $installPath to PATH"
127+
echo "$installPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
128+
129+
Write-Host "MDBTools installed at $installPath"
120130
shell: pwsh
121131

122132
- name: Verify MDBTools installation

0 commit comments

Comments
 (0)