Skip to content

Compile for Ruby 3.4 #10

Compile for Ruby 3.4

Compile for Ruby 3.4 #10

Workflow file for this run

name: Build Gem
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize]
branches:
- '*'
jobs:
build-ruby:
name: ruby
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Build gem
run: gem build *.gemspec
- name: Run tests
run: |
gem install *.gem
bundle install
rake test:gem
- uses: actions/upload-artifact@v4
with:
name: "ruby-gem"
path: "*.gem"
build-native:
needs: ['build-ruby']
strategy:
matrix:
platform: ['x86-mingw32', 'x64-mingw-ucrt', 'x64-mingw32', 'x86_64-linux', 'x86_64-darwin', 'arm64-darwin']
name: "${{ matrix.platform }}"
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
container:
image: "ghcr.io/rake-compiler/rake-compiler-dock-image:1.7.0-mri-${{ matrix.platform }}"
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build native gem
shell: bash
run: |
bundle install
bundle exec rake gem:${{ matrix.platform }}:build
- uses: actions/upload-artifact@v4
with:
name: "${{ matrix.platform }}-gem"
path: pkg/*.gem
publish:
# if: startsWith(github.ref, 'refs/tags/v')
needs: ['build-ruby', 'build-native']
strategy:
matrix:
platform: ['ruby', 'x86-mingw32', 'x64-mingw-ucrt', 'x64-mingw32', 'x86_64-linux', 'x86_64-darwin', 'arm64-darwin']
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: "${{ matrix.platform }}-gem"
path: pkg
- name: List files
run: ls -l pkg
# - name: Publish to RubyGems
# shell: bash
# run: |
# mkdir -p $HOME/.gem
# touch $HOME/.gem/credentials
# chmod 0600 $HOME/.gem/credentials
# printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
# gem push pkg/*.gem
# env:
# GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"