Skip to content

bump rb-sys version

bump rb-sys version #3

name: Release engine/language_client_ruby
on:
workflow_dispatch: {}
push:
branches:
- sam/build-checker
permissions:
contents: read
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
ruby-version: ["3.3", "3.2", "3.1"]
_:
- platform: x86_64-linux
rb-sys-dock-setup: sudo yum install -y perl-IPC-Cmd
- platform: aarch64-linux
- platform: x86_64-darwin
- platform: arm64-darwin
#- x64-mingw-ucrt
name: build (${{ matrix._.platform }}, ruby ${{ matrix.ruby-version }})
runs-on: ubuntu-latest
defaults:
run:
working-directory: engine/language_client_ruby
steps:
- uses: rubygems/configure-rubygems-credentials@main
with:
# https://rubygems.org/profile/oidc/api_key_roles/rg_oidc_akr_p6x4xz53qtk948na3bgy
role-to-assume: rg_oidc_akr_p6x4xz53qtk948na3bgy
- uses: actions/checkout@v4
- uses: oxidize-rb/actions/setup-ruby-and-rust@main
with:
rubygems: latest
ruby-version: "3.3"
bundler-cache: false
cargo-cache: false
cargo-vendor: false
#################################################################################################################
#
# BEGIN: these steps are copied from https://github.com/oxidize-rb/actions/blob/main/cross-gem/action.yml
#
# We can't use oxidize-rb/actions/cross-gem@main directly, unfortunately, because our Ruby FFI lib is a member
# of the top-level workspace, and we need to do stuff to make rb-sys-dock play nice with it
#
#################################################################################################################
- name: Configure environment
shell: bash
id: configure
run: |
: Configure environment
echo "RB_SYS_DOCK_UID=$(id -u)" >> $GITHUB_ENV
echo "RB_SYS_DOCK_GID=$(id -g)" >> $GITHUB_ENV
rb_sys_version="$((grep rb_sys Gemfile.lock | head -n 1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') || (gem info rb_sys --remote | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') || echo "latest")"
rb_sys_dock_cache_dir="$HOME/.cache/rb-sys-$rb_sys_version"
mkdir -p "$rb_sys_dock_cache_dir"
echo "RB_SYS_DOCK_CACHE_DIR=$rb_sys_dock_cache_dir" >> $GITHUB_ENV
echo "rb_sys_version=$rb_sys_version" >> $GITHUB_OUTPUT
#- name: Setup caching
# uses: actions/cache@v4
# with:
# path: |
# ${{ env.RB_SYS_DOCK_CACHE_DIR }}
# tmp/rb-sys-dock/${{ inputs.platform }}/target
# key: rb-sys-dock-${{ inputs.cache-version }}-${{ inputs.platform }}-${{ hashFiles('**/Gemfile.lock', '**/Cargo.lock') }}
# save-always: ${{ inputs.cache-save-always == 'true' }}
# restore-keys: |
# rb-sys-dock-${{ inputs.cache-version }}-${{ inputs.platform }}-
#- name: Install cargo-cache
# uses: oxidize-rb/actions/cargo-binstall@v1
# id: install-cargo-cache
# if: inputs.cargo-cache-clean == 'true'
# with:
# crate: cargo-cache
# version: 0.8.3
# strategies: quick-install
#- name: Clean the cargo cache
# if: inputs.cargo-cache-clean == 'true'
# uses: oxidize-rb/actions/post-run@v1
# with:
# run: cargo-cache --autoclean
# cwd: ${{ inputs.working-directory }}
# always: ${{ inputs.cache-save-always == 'true' }}
- name: Setup rb-sys
shell: bash
run: |
version="${{ steps.configure.outputs.rb_sys_version }}"
echo "Installing rb_sys@$version"
if [ "$version" = "latest" ]; then
gem install rb_sys
else
gem install rb_sys -v $version
fi
- name: Build gem
shell: bash
working-directory: engine
# if: ${{ matrix._.platform == 'x86_64-linux' }}
run: |
: Compile gem
echo "Docker Working Directory: $(pwd)"
set -x
rb-sys-dock \
--platform ${{ matrix._.platform }} \
--mount-toolchains \
--directory language_client_ruby \
--ruby-versions ${{ matrix.ruby-version }} \
--build \
-- ${{ matrix._.rb-sys-dock-setup }}
# --
# - name: Build gem
# shell: bash
# working-directory: engine
# if: ${{ matrix._.platform != 'x86_64-linux' }}
# run: |
# : Compile gem
# echo "Docker Working Directory: $(pwd)"
# set -x
# rb-sys-dock \
# --platform ${{ matrix._.platform }} \
# --mount-toolchains \
# --directory language_client_ruby \
# --ruby-versions ${{ matrix.ruby-version }} \
# --build
#################################################################################################################
#
# END: these steps are copied from https://github.com/oxidize-rb/actions/blob/main/cross-gem/action.yml
#
# We can't use oxidize-rb/actions/cross-gem@main directly, unfortunately, because our Ruby FFI lib is a member
# of the top-level workspace, and we need to do stuff to make rb-sys-dock play nice with it
#
#################################################################################################################
- name: Upload Ruby artifact
uses: actions/upload-artifact@v4
with:
name: gem-${{ matrix._.target }}
path: pkg/*.gem
if-no-files-found: error
# - run: |
# for i in $(ls pkg/*.gem); do
# gem push $i
# done