Skip to content

Commit

Permalink
Use gem unpack to get precompiled extensions on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
andyundso committed Jul 16, 2024
1 parent 7f51901 commit d8e1e3b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down Expand Up @@ -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/[email protected]
Expand Down

0 comments on commit d8e1e3b

Please sign in to comment.