Skip to content

Commit 28638de

Browse files
schneemsedmorley
andauthored
Add a mechanism for documenting Ruby versions via automation (#1551)
* Add a mechanism for documenting Ruby versions via automation Our current deploy process looks like this for releasing a Ruby version: - Manually make a PR to the Ruby buildpack with the version in the changelog - Get it approved by another engineer - PreRelease the buildpack via automation - Merge the pre-release PR - Pull changes locally and run deploy command `bundle exec rake buildpack:release` - Then trigger S3 changes via running automations on https://github.com/heroku/docker-heroku-ruby-builder In the future there's a desire to have the https://github.com/heroku/docker-heroku-ruby-builder generate an "inventory" file that tracks binary checksums and then the buildpack will require a PR to utilize new versions. However, that's a non-trivial amount of work and Ruby versions keep getting released on Fridays when I'm on vacation and no one else is around. With this change the process can look like this: - Trigger this new workflow which updates the CHANGELOG.md and runs the pre-release automation in one - Merge that PR - Pull changes locally and run deploy command `bundle exec rake buildpack:release` - Then trigger S3 changes via running automations on https://github.com/heroku/docker-heroku-ruby-builder Which is a substantial workflow savings. This task can be removed once we implement the full inventory workflow (sometime in the vague future), but this is a quality of life upgrade for the short term. * Apply suggestions from code review Co-authored-by: Ed Morley <[email protected]> --------- Co-authored-by: Ed Morley <[email protected]>
1 parent fb393cb commit 28638de

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Add Ruby version to changelog && prepare release
2+
run-name: "Add ${{ inputs.is_jruby && 'J' || ''}}Ruby ${{ inputs.ruby_version }} to the CHANGELOG.md and prepare a release"
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
ruby_version:
8+
description: "The Ruby version to announce"
9+
type: string
10+
required: true
11+
is_jruby:
12+
description: "JRuby release? (as opposed to MRI)"
13+
type: boolean
14+
default: false
15+
required: false
16+
17+
# Disable all GITHUB_TOKEN permissions, since the GitHub App token is used instead.
18+
permissions: {}
19+
20+
jobs:
21+
prepare-release:
22+
uses: heroku/languages-github-actions/.github/workflows/_classic-buildpack-prepare-release.yml@latest
23+
secrets: inherit
24+
with:
25+
custom_update_command: |
26+
set -euo pipefail
27+
28+
sed --in-place '/## \[Unreleased\]/a\
29+
\
30+
- ${{ inputs.is_jruby && 'J' || ''}}Ruby ${{inputs.ruby_version}} is now available
31+
' CHANGELOG.md
32+
33+
sed --in-place --regexp-extended \
34+
--expression "s/v${EXISTING_VERSION}/v${NEW_VERSION}/" \
35+
lib/language_pack/version.rb
36+
37+
if compgen -G 'changelogs/unreleased/*.md' > /dev/null; then
38+
# The unreleased changelogs directory contains a `.gitkeep` file, so we have to
39+
# copy the markdown files individually instead of renaming the directory.
40+
NEW_CHANGELOG_DIR="changelogs/v${NEW_VERSION}/"
41+
mkdir -p "${NEW_CHANGELOG_DIR}"
42+
mv changelogs/unreleased/*.md "${NEW_CHANGELOG_DIR}"
43+
fi

0 commit comments

Comments
 (0)