diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f209ad03..6d3781c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,8 +66,6 @@ jobs: name: install-windows-mingw runs-on: windows-latest steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} @@ -80,13 +78,7 @@ jobs: - name: Install native gem shell: pwsh - run: | - $rubyArchitecture = (ruby -e "puts RbConfig::CONFIG['arch']").Trim() - $gemVersion = (Get-Content VERSION).Trim() - $gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" - - Write-Host "Looking to install $gemToInstall" - gem install "$gemToInstall" + run: gem install "tiny_tds-*.gem" - name: Test if TinyTDS loads shell: pwsh @@ -191,8 +183,6 @@ jobs: name: install-windows-ucrt runs-on: windows-latest steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} @@ -205,13 +195,7 @@ jobs: - name: Install native gem shell: pwsh - run: | - $rubyArchitecture = (ruby -e "puts RbConfig::CONFIG['arch']").Trim() - $gemVersion = (Get-Content VERSION).Trim() - $gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" - - Write-Host "Looking to install $gemToInstall" - gem install "$gemToInstall" + run: gem install "tiny_tds-*.gem" - name: Test if TinyTDS loads shell: pwsh @@ -389,8 +373,6 @@ jobs: name: install-linux runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 - - name: Download precompiled gem uses: actions/download-artifact@v4 with: @@ -407,7 +389,7 @@ jobs: sh -c " gem update --system 3.3.22 && ${{ matrix.bootstrap }} - gem install --no-document ./gems/tiny_tds-$(cat VERSION)-${{ matrix.platform }}.gem && + gem install --no-document ./gems/tiny_tds-*.gem && ruby -e \"require 'tiny_tds'; puts TinyTds::Gem.root_path\" && tsql-ttds -C && defncopy-ttds -v @@ -425,7 +407,6 @@ jobs: - true mssql-version: - - 2017 - 2019 - 2022 diff --git a/CHANGELOG.md b/CHANGELOG.md index a44bf42a..cc7e4b3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.2.1 + +* Ensure the native Gem loads on Windows. Fixes #581. + ## 3.2.0 * Reduce number of files shipped with precompiled Windows gem diff --git a/VERSION b/VERSION index 944880fa..e4604e3a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.0 +3.2.1 diff --git a/lib/tiny_tds.rb b/lib/tiny_tds.rb index e00c7373..3caa8dcf 100644 --- a/lib/tiny_tds.rb +++ b/lib/tiny_tds.rb @@ -11,7 +11,7 @@ module TinyTds # Is this file part of a fat binary gem with bundled freetds? # This path must be enabled by add_dll_directory on Windows. gplat = ::Gem::Platform.local - FREETDS_LIB_PATH = Dir[File.expand_path("../ports/#{gplat.cpu}-#{gplat.os}*/lib", __dir__)].first + FREETDS_LIB_PATH = Dir[File.expand_path("../ports/#{gplat.cpu}-#{gplat.os}*/{bin,lib}", __dir__)].first add_dll_path = proc do |path, &block| if RUBY_PLATFORM =~ /(mswin|mingw)/i && path