Add Ruby 11:58 to the CHANGELOG.md and prepare a release #10
Workflow file for this run
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: Add Ruby version to changelog && prepare release | |
run-name: "Add ${{ inputs.is_jruby && 'J' || ''}}Ruby ${{ inputs.ruby_version }} to the CHANGELOG.md and prepare a release" | |
on: | |
workflow_dispatch: | |
inputs: | |
ruby_version: | |
description: "The Ruby version to announce" | |
type: string | |
required: true | |
is_jruby: | |
description: "JRuby release? (as opposed to MRI)" | |
type: boolean | |
default: false | |
required: false | |
# Disable all GITHUB_TOKEN permissions, since the GitHub App token is used instead. | |
permissions: {} | |
jobs: | |
prepare-release: | |
uses: heroku/languages-github-actions/.github/workflows/_classic-buildpack-prepare-release.yml@latest | |
secrets: inherit | |
with: | |
custom_update_command: | | |
set -euo pipefail | |
DATE_TODAY="$(date --utc --iso-8601)" | |
sed --in-place "/## \[v${NEW_VERSION}\] - ${DATE_TODAY}/a\\ | |
\\ | |
- ${{ inputs.is_jruby && 'J' || ''}}Ruby ${{inputs.ruby_version}} is now available | |
" CHANGELOG.md | |
sed --in-place --regexp-extended \ | |
--expression "s/v${EXISTING_VERSION}/v${NEW_VERSION}/" \ | |
lib/language_pack/version.rb | |
if compgen -G 'changelogs/unreleased/*.md' > /dev/null; then | |
# The unreleased changelogs directory contains a `.gitkeep` file, so we have to | |
# copy the markdown files individually instead of renaming the directory. | |
NEW_CHANGELOG_DIR="changelogs/v${NEW_VERSION}/" | |
mkdir -p "${NEW_CHANGELOG_DIR}" | |
mv changelogs/unreleased/*.md "${NEW_CHANGELOG_DIR}" | |
fi |