Skip to content

Commit

Permalink
Merge pull request #420 from bytecodealliance/update-cross-gem
Browse files Browse the repository at this point in the history
Update cross-gem action
  • Loading branch information
jbourassa authored Jan 14, 2025
2 parents 6139a43 + f10e463 commit ad12590
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 37 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/build-gems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,25 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: oxidize-rb/actions/setup-ruby-and-rust@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
cargo-cache: true
cargo-vendor: true
cache-version: v2-${{ matrix.ruby-platform }}

- name: Set vars
id: vars
run: |
echo "rb-sys-version=$(bundle exec ruby -rrb_sys -e 'puts RbSys::VERSION')" >> $GITHUB_OUTPUT

- uses: oxidize-rb/cross-gem-action@main
- uses: oxidize-rb/actions/cross-gem@v1
id: cross-gem
with:
version: ${{ steps.vars.outputs.rb-sys-version }}
platform: ${{ matrix.ruby-platform }}
ruby-versions: ${{ join(fromJSON(needs.ci-data.outputs.result).stable-ruby-versions, ', ') }}
ruby-versions: ${{ join(fromJSON(needs.ci-data.outputs.result).stable-ruby-versions, ',') }}

- uses: actions/upload-artifact@v4
with:
name: cross-gem-${{ matrix.ruby-platform }}
path: ${{ steps.cross-gem.outputs.gem-path }}
if-no-files-found: error

- name: Smoke gem install
if: matrix.ruby-platform == 'x86_64-linux' # GitHub actions architecture
run: bundle exec rake pkg:${{ matrix.ruby-platform }}:test
run: bundle install && bundle exec rake pkg:${{ matrix.ruby-platform }}:test

source:
name: Build source gem
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: oxidize-rb/actions/setup-ruby-and-rust@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
cargo-cache: true
cargo-vendor: true
cache-version: v1-${{ matrix.ruby-platform }}
ruby-version: "3.4"

- uses: oxidize-rb/cross-gem-action@main
- uses: oxidize-rb/actions/cross-gem@v1
id: cross-gem
with:
version: latest
platform: ${{ matrix.ruby-platform }}
ruby-versions: ${{ join(fromJSON(needs.ci-data.outputs.result).stable-ruby-versions, ', ') }}
ruby-versions: ${{ join(fromJSON(needs.ci-data.outputs.result).stable-ruby-versions, ',') }}

- uses: actions/upload-artifact@v4
with:
name: cross-gem-${{ matrix.ruby-platform }}
path: pkg/*-${{ matrix.ruby-platform }}.gem
if-no-files-found: error

- name: Smoke gem install
if: matrix.ruby-platform == 'x86_64-linux' # GitHub actions architecture
Expand All @@ -71,18 +73,16 @@ jobs:

- uses: oxidize-rb/actions/setup-ruby-and-rust@v1
with:
ruby-version: "3.3"
ruby-version: "3.4"
bundler-cache: true
cargo-cache: true
cache-version: v1

# It seems that v4 is not compatible with how artifacts are uploaded by
# oxidize-rb/cross-gem-action. So this must stay as v3 until the issue
# below is fixed.
# See https://github.com/oxidize-rb/actions/issues/27, for more details.
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: cross-gem
pattern: cross-gem-*
merge-multiple: true
path: pkg/

- name: Package source gem
run: bundle exec rake pkg:ruby
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: .
specs:
wasmtime (28.0.0)
rb_sys (~> 0.9.107)
rb_sys (~> 0.9.108)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -38,7 +38,7 @@ GEM
rake (13.2.1)
rake-compiler (1.2.9)
rake
rb_sys (0.9.107)
rb_sys (0.9.108)
regexp_parser (2.10.0)
rspec (3.13.0)
rspec-core (~> 3.13.0)
Expand Down
2 changes: 1 addition & 1 deletion wasmtime.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ Gem::Specification.new do |spec|

spec.rdoc_options += ["--exclude", "vendor"]

spec.add_dependency "rb_sys", "~> 0.9.107"
spec.add_dependency "rb_sys", "~> 0.9.108"
end

0 comments on commit ad12590

Please sign in to comment.