Skip to content

CI: build packages

CI: build packages #33

Workflow file for this run

name: Ruby
on:
push:
pull_request:
schedule:
- cron: '35 6 * * *'
workflow_dispatch:
jobs:
ruby-versions:
if: ${{ startsWith(github.repository, 'ruby/') || github.event_name != 'schedule' }}
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
engine: cruby-jruby
min_version: 3.3
build:
needs: ruby-versions
name: CI (${{ matrix.ruby }} / ${{ matrix.os }})
runs-on: ${{ matrix.os }}
outputs:
chksum_ubuntu: ${{ steps.build.outputs.chksum_ubuntu }}
chksum_windows: ${{ steps.build.outputs.chksum_windows }}
strategy:
matrix:
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
os: [ ubuntu-24.04, windows-latest ]
steps:
- name: git config
run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global advice.detachedHead 0
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
- id: build
run: |
bundle exec rake build
sum="`sha256sum -b pkg/*`"
echo "$sum"
echo "chksum_${BUILD_PLATFORM%%-*}=$sum" >> $GITHUB_OUTPUT
echo "pkg=${GITHUB_REPOSITORY#*/}" >> $GITHUB_OUTPUT
if: >-
${{
github.event_name == 'push' &&
(matrix.ruby == needs.ruby-versions.outputs.latest)
}}
env:
BUILD_PLATFORM: ${{ matrix.os }}
shell: bash
- name: Upload package
uses: actions/upload-artifact@v4
with:
path: pkg/*.gem
name: ${{steps.build.outputs.pkg}}-${{matrix.os}}
if: >-
steps.build.outputs.pkg &&
startsWith(matrix.os, 'ubuntu')
comp:
name: ${{ github.workflow }} result
runs-on: ubuntu-latest
needs: [build]
steps:
- run: test "$chksum_ubuntu" = "$chksum_windows"
working-directory:
shell: bash
env:
chksum_ubuntu: ${{ needs.build.outputs.chksum_ubuntu }}
chksum_windows: ${{ needs.build.outputs.chksum_windows }}