From d8e1e3bb9214fcb8d6a9fc8e1a6f9fbf5c6e2d2e Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 16 Jul 2024 22:39:36 +0200 Subject: [PATCH] Use `gem unpack` to get precompiled extensions on Windows --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6af6e9ef..ec10e7c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,18 +132,18 @@ jobs: run: | $rubyArchitecture = (ruby -e "puts RbConfig::CONFIG['arch']").Trim() $gemVersion = (Get-Content VERSION).Trim() - $gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" + $gemToUnpack = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" - Write-Host "Looking to install $gemToInstall" - gem install --local --install-dir=./tmp "$gemToInstall" + Write-Host "Looking to unpack $gemToUnpack" + gem unpack --target ./tmp "$gemToUnpack" # Restore precompiled code - $source = (Resolve-Path ".\tmp\gems\tiny_tds-$gemVersion-$rubyArchitecture\lib\tiny_tds").Path + $source = (Resolve-Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\lib\tiny_tds").Path $destination = (Resolve-Path ".\lib\tiny_tds").Path Get-ChildItem $source -Recurse -Exclude "*.rb" | Copy-Item -Destination {Join-Path $destination $_.FullName.Substring($source.length)} # Restore ports - Copy-Item -Path ".\tmp\gems\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse + Copy-Item -Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse - name: Setup MSSQL uses: potatoqualitee/mssqlsuite@v1.7 @@ -257,18 +257,18 @@ jobs: run: | $rubyArchitecture = (ruby -e "puts RbConfig::CONFIG['arch']").Trim() $gemVersion = (Get-Content VERSION).Trim() - $gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" + $gemToUnpack = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" - Write-Host "Looking to install $gemToInstall" - gem install --local --install-dir=./tmp "$gemToInstall" + Write-Host "Looking to unpack $gemToUnpack" + gem unpack --target ./tmp "$gemToUnpack" # Restore precompiled code - $source = (Resolve-Path ".\tmp\gems\tiny_tds-$gemVersion-$rubyArchitecture\lib\tiny_tds").Path + $source = (Resolve-Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\lib\tiny_tds").Path $destination = (Resolve-Path ".\lib\tiny_tds").Path Get-ChildItem $source -Recurse -Exclude "*.rb" | Copy-Item -Destination {Join-Path $destination $_.FullName.Substring($source.length)} # Restore ports - Copy-Item -Path ".\tmp\gems\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse + Copy-Item -Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse - name: Setup MSSQL uses: potatoqualitee/mssqlsuite@v1.7