Skip to content

Build and upload Ruby 3.1.5 #37

Build and upload Ruby 3.1.5

Build and upload Ruby 3.1.5 #37

Workflow file for this run

name: Build and upload Ruby runtime
run-name: "Build and upload Ruby ${{ inputs.ruby_version }}${{ inputs.dry_run && ' (dry run)' || '' }}"
on:
workflow_dispatch:
inputs:
ruby_version:
description: "The Ruby version to build, specified as X.Y.Z"
type: string
required: true
dry_run:
description: "Skip deploying to S3 (e.g. for testing)"
type: boolean
default: false
required: false
permissions:
contents: read
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
S3_BUCKET: "heroku-buildpack-ruby"
jobs:
build-and-upload-heroku-20:
runs-on: pub-hk-ubuntu-22.04-xlarge
env:
STACK: "heroku-20"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Output CHANGELOG
run: bin/print_changelog "${{inputs.ruby_version}}"
- name: Build Docker image
run: bin/activate_docker "$STACK"
- name: Build and package Ruby runtime
run: bin/build_ruby "$STACK" "${{inputs.ruby_version}}"
- name: Verify ruby executable and output rubygems version
run: bin/print_summary "$STACK" "${{inputs.ruby_version}}" | tee $GITHUB_STEP_SUMMARY
- name: Upload Ruby runtime archive to S3 dry run
if: (inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}" --dryrun
- name: Upload Ruby runtime archive to S3 production
if: (!inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}"
build-and-upload-heroku-22:
if: (!startsWith(inputs.ruby_version, '3.0')) # https://bugs.ruby-lang.org/issues/18658
runs-on: pub-hk-ubuntu-22.04-xlarge
env:
STACK: "heroku-22"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Output CHANGELOG
run: bin/print_changelog "${{inputs.ruby_version}}"
- name: Build Docker image
run: bin/activate_docker "$STACK"
- name: Build and package Ruby runtime
run: bin/build_ruby "$STACK" "${{inputs.ruby_version}}"
- name: Verify ruby executable and output rubygems version
run: bin/print_summary "$STACK" "${{inputs.ruby_version}}" | tee $GITHUB_STEP_SUMMARY
- name: Upload Ruby runtime archive to S3 dry run
if: (inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}" --dryrun
- name: Upload Ruby runtime archive to S3 production
if: (!inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}"
build-and-upload-heroku-24-amd:
if: (!startsWith(inputs.ruby_version, '3.0')) # https://bugs.ruby-lang.org/issues/18658
runs-on: pub-hk-ubuntu-22.04-xlarge
env:
STACK: "heroku-24"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Output CHANGELOG
run: bin/print_changelog "${{inputs.ruby_version}}"
- name: Build Docker image
run: bin/activate_docker "$STACK"
- name: Build and package Ruby runtime
run: bin/build_ruby "$STACK" "${{inputs.ruby_version}}"
- name: Verify ruby executable and output rubygems version
run: bin/print_summary "$STACK" "${{inputs.ruby_version}}" amd64 | tee $GITHUB_STEP_SUMMARY
- name: Upload Ruby runtime archive to S3 dry run
if: (inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}" --dryrun
- name: Upload Ruby runtime archive to S3 production
if: (!inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}"
build-and-upload-heroku-24-arm:
if: (!startsWith(inputs.ruby_version, '3.0')) # https://bugs.ruby-lang.org/issues/18658
runs-on: pub-hk-ubuntu-22.04-arm-large
env:
STACK: "heroku-24"
steps:
- name: Checkout
uses: actions/checkout@v4
# Docker (and other tools) are not present on the early-access runners.
# We must install them manually: https://github.com/github-early-access/arm-runners-beta
- name: Install docker
run: |
bin/setup_docker_ci
sudo usermod -aG docker $USER
sudo apt-get install acl
sudo setfacl --modify user:$USER:rw /var/run/docker.sock
# AWS CLI (and other tools) are not present on the early-access runners.
# We must install them manually: https://github.com/github-early-access/arm-runners-beta
- name: Install AWS CLI
run: | # https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
sudo apt-get install -y unzip
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- name: Output CHANGELOG
run: bin/print_changelog "${{inputs.ruby_version}}"
- name: Build Docker image
run: bin/activate_docker "$STACK"
- name: Build and package Ruby runtime
run: bin/build_ruby "$STACK" "${{inputs.ruby_version}}"
- name: Verify ruby executable and output rubygems version
run: bin/print_summary "$STACK" "${{inputs.ruby_version}}" arm64 | tee $GITHUB_STEP_SUMMARY
- name: Upload Ruby runtime archive to S3 dry run
if: (inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}" --dryrun
- name: Upload Ruby runtime archive to S3 production
if: (!inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}"