-
Notifications
You must be signed in to change notification settings - Fork 3
80 lines (75 loc) · 2.8 KB
/
build_ruby.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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@v3
- name: Set up Ruby
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.1'
- name: Install dependencies
run: bundle install
- name: Output CHANGELOG
run: bundle exec rake "changelog[${{inputs.ruby_version}}]"
- name: Build Docker image
run: bundle exec rake "generate_image[$STACK]"
- name: Generate Ruby Dockerfile
run: bundle exec rake "new[${{inputs.ruby_version}},$STACK]"
- name: Build and package Ruby runtime
run: bash "rubies/$STACK/ruby-${{inputs.ruby_version}}.sh"
- name: Upload Ruby runtime archive to S3
if: (!inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}"
- name: Output Rubygems version
run: bundle exec rake "rubygems_version[${{inputs.ruby_version}},$STACK]"
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@v3
- name: Set up Ruby
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.1'
- name: Install dependencies
run: bundle install
- name: Output CHANGELOG
run: bundle exec rake "changelog[${{inputs.ruby_version}}]"
- name: Build Docker image
run: bundle exec rake "generate_image[$STACK]"
- name: Generate Ruby Dockerfile
run: bundle exec rake "new[${{inputs.ruby_version}},$STACK]"
- name: Build and package Ruby runtime
run: bash "rubies/$STACK/ruby-${{inputs.ruby_version}}.sh"
- name: Upload Ruby runtime archive to S3
if: (!inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}"
- name: Output Rubygems version
run: bundle exec rake "rubygems_version[${{inputs.ruby_version}},$STACK]"