Automate per-package release for specific components (#2875)

This commit is contained in:
Liudmila Molkova
2024-10-09 09:20:02 -07:00
committed by GitHub
parent 6bb6d3896d
commit 6a54106f5b
30 changed files with 1058 additions and 107 deletions

View File

@ -0,0 +1,26 @@
#!/bin/bash
# This script copies release notes for the current version from CHANGELOG.md file
# and stores them in /tmp/release-notes.txt.
# It also stores them in a /tmp/CHANGELOG_SECTION.md which is used later to copy them over to the
# CHANGELOG in main branch which is done by merge_changelog_to_main script.
# This script is called from the release workflows (package-release.yml and release.yml).
set -ev
# conditional block not indented because of the heredoc
if [[ ! -z $PRIOR_VERSION_WHEN_PATCH ]]; then
cat > /tmp/release-notes.txt << EOF
This is a patch release on the previous $PRIOR_VERSION_WHEN_PATCH release, fixing the issue(s) below.
EOF
fi
# CHANGELOG_SECTION.md is also used at the end of the release workflow
# for copying the change log updates to main
sed -n "0,/^## Version ${VERSION}/d;/^## Version /q;p" $CHANGELOG > /tmp/CHANGELOG_SECTION.md
# the complex perl regex is needed because markdown docs render newlines as soft wraps
# while release notes render them as line breaks
perl -0pe 's/(?<!\n)\n *(?!\n)(?![-*] )(?![1-9]+\. )/ /g' /tmp/CHANGELOG_SECTION.md >> /tmp/release-notes.txt