Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use oxidize-rb/actions/cross-gem@v1 instead of oxidize-rb/cross-gem-action@main #220

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions .github/workflows/gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
- "x86_64-darwin"
- "x86_64-linux-gnu"
- "x86_64-linux-musl"
- "x64-mingw32"
- "x64-mingw-ucrt"
environment: "yrb-deploy"
steps:
Expand All @@ -35,21 +34,11 @@ jobs:
cargo-cache: true
cargo-vendor: true

- name: Transform platform name
id: transform_platform
run: echo "cross_gem_platform=$(echo '${{ matrix.platform }}' | sed 's/-gnu$//')" >> $GITHUB_ENV

- uses: oxidize-rb/cross-gem-action@main
with:
platform: ${{ env.cross_gem_action_platform }}
version: 'latest'
env: |
RUBY_CC_VERSION=3.4.0:3.3.5:3.2.0:3.1.0

- uses: actions/download-artifact@v3
- uses: oxidize-rb/actions/cross-gem@v1
id: cross-gem
with:
name: cross-gem
path: pkg/
platform: ${{ matrix.platform }}
ruby-versions: '3.1,3.2,3.3,3.4'

- name: Display structure of built gems
run: ls -R
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-3.2.0
ruby-3.4.1
66 changes: 38 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

require "bundler/gem_tasks"
require "rubygems/package_task"
require "rake_compiler_dock"
require "rake/testtask"
require "rake/extensiontask"
require "rb_sys"

cross_rubies = %w[3.4.0 3.3.5 3.2.0 3.1.0]
ruby_cc_version = RakeCompilerDock.ruby_cc_version([">= 3.1", "< 3.5"])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rake-compiler-dock now needs exact patch versions, so this method abstracts those details.

cross_platforms = %w[
aarch64-linux-gnu
aarch64-linux-musl
Expand Down Expand Up @@ -41,15 +42,11 @@ namespace "gem" do
cross_platforms.each do |plat|
desc "Build the native gem for #{plat}"
task plat => "prepare" do
require "rake_compiler_dock"

# rbsys doesn't ship an alias -gnu image yet
rcd_plat = plat.gsub(/-gnu$/, '')
ENV["RCD_IMAGE"] = "rbsys/#{rcd_plat}:#{RbSys::VERSION}"
ENV["RCD_IMAGE"] = "rbsys/#{plat}:#{RbSys::VERSION}"

RakeCompilerDock.sh <<~SH, platform: plat
bundle && \
RUBY_CC_VERSION="#{cross_rubies.join(":")}" \
RUBY_CC_VERSION="#{ruby_cc_version}"
rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem
SH
end
Expand Down
3 changes: 1 addition & 2 deletions y-rb.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ Gem::Specification.new do |spec|
spec.metadata["rubygems_mfa_required"] = "true"

spec.add_dependency "rake", "~> 13.2"
spec.add_dependency "rb_sys", "~> 0.9.86"
spec.add_dependency "rb_sys", "~> 0.9.110"

spec.add_development_dependency "base64"
spec.add_development_dependency "rake-compiler", "~> 1.2.1"
spec.add_development_dependency "rake-compiler-dock", "~> 1.9.1"
Copy link
Contributor Author

@stanhu stanhu Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rb_sys now depends on a specific version of rake-compiler-dock, so let's just use that as the hard dependency.


spec.extensions = ["ext/yrb/extconf.rb"]
end
Loading