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 Oct 22, 2024
1 parent cb97ae4 commit e979b0b
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 @@ -124,18 +124,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 @@ -245,18 +245,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 e979b0b

Please sign in to comment.