Build and upload Ruby 3.4.0-rc1 (dry run) #54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
runs-on: ${{ matrix.arch == 'arm64' && 'pub-hk-ubuntu-24.04-arm-xlarge' || 'pub-hk-ubuntu-24.04-xlarge' }} | |
strategy: | |
matrix: | |
arch: ["amd64", "arm64"] | |
base_image: ["heroku-20", "heroku-22", "heroku-24"] | |
exclude: | |
- base_image: "heroku-20" | |
arch: "arm64" | |
- base_image: "heroku-22" | |
arch: "arm64" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Update Rust toolchain | |
run: rustup update | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
- name: Cargo build | |
run: cargo build | |
- name: Output CHANGELOG | |
run: cargo run --bin ruby_changelog -- --version "${{inputs.ruby_version}}" | |
- name: Build Ruby | |
run: cargo run --bin ruby_build -- --version ${{inputs.ruby_version}} --base-image ${{matrix.base_image}} --arch ${{matrix.arch}} | |
- name: Check Ruby | |
run: cargo run --bin ruby_check -- --version ${{inputs.ruby_version}} --base-image ${{matrix.base_image}} --arch ${{matrix.arch}} | tee $GITHUB_STEP_SUMMARY | |
- name: Upload Ruby runtime archive to S3 dry run | |
if: (inputs.dry_run) | |
run: aws s3 sync ./output "s3://${S3_BUCKET}" --dryrun | |
- name: Upload Ruby runtime archive to S3 production | |
if: (!inputs.dry_run) | |
run: aws s3 sync ./output "s3://${S3_BUCKET}" | |
after-build-and-upload: | |
needs: build-and-upload | |
runs-on: pub-hk-ubuntu-24.04-xlarge | |
steps: | |
- name: Update Ruby inventory file locally | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
path: ruby_inventory.toml | |
title: "Add Ruby ${{inputs.ruby_version}} to inventory" |