From 554fe0b9463d8a50727decf2085c5dc39ba28fde Mon Sep 17 00:00:00 2001 From: Alex Garcia Date: Tue, 16 May 2023 10:30:58 -0700 Subject: [PATCH] inject env var to hardcode spec.platform --- .github/workflows/release.yaml | 28 ++++++++++++---------------- bindings/ruby/sqlite_hello.gemspec | 2 +- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 74c2961..29268a0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -98,31 +98,27 @@ jobs: - run: | rm bindings/ruby/lib/*.{dylib,so,dll} || true cp sqlite-hello-macos-x86_64-extension/*.dylib bindings/ruby/lib - gem -C bindings/ruby build \ - --platform x86_64-darwin \ - -o x86_64-darwin.gem \ - sqlite_hello.gemspec + gem -C bindings/ruby build -o x86_64-darwin.gem sqlite_hello.gemspec + env: + PLATFORM: x86_64-darwin - run: | rm bindings/ruby/lib/*.{dylib,so,dll} || true cp sqlite-hello-macos-aarch64-extension/*.dylib bindings/ruby/lib - gem -C bindings/ruby build \ - --platform arm64-darwin \ - -o arm64-darwin.gem \ - sqlite_hello.gemspec + gem -C bindings/ruby build -o arm64-darwin.gem sqlite_hello.gemspec + env: + PLATFORM: arm64-darwin - run: | rm bindings/ruby/lib/*.{dylib,so,dll} || true cp sqlite-hello-linux-x86_64-extension/*.so bindings/ruby/lib - gem -C bindings/ruby build \ - --platform x86_64-linux \ - -o x86_64-linux.gem \ - sqlite_hello.gemspec + gem -C bindings/ruby build -o x86_64-linux.gem sqlite_hello.gemspec + env: + PLATFORM: x86_64-linux - run: | rm bindings/ruby/lib/*.{dylib,so,dll} || true cp sqlite-hello-windows-x86_64-extension/*.dll bindings/ruby/lib - gem -C bindings/ruby build \ - --platform x64-mingw32 \ - -o x64-mingw32.gem \ - sqlite_hello.gemspec + gem -C bindings/ruby build -o x64-mingw32.gem sqlite_hello.gemspec + env: + PLATFORM: x64-mingw32 - run: | gem push bindings/ruby/x86_64-darwin.gem gem push bindings/ruby/arm64-darwin.gem diff --git a/bindings/ruby/sqlite_hello.gemspec b/bindings/ruby/sqlite_hello.gemspec index d683751..e1ef4cc 100644 --- a/bindings/ruby/sqlite_hello.gemspec +++ b/bindings/ruby/sqlite_hello.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |spec| spec.homepage = "https://github.com/asg017/sqlite-ecosystem" spec.license = "MIT" - spec.platform = Gem::Platform::CURRENT + spec.platform = ENV['PLATFORM'] if spec.respond_to?(:metadata)