mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-31 09:49:03 +00:00
61c315cbfb
The Linux, macOS and Windows workflows build every file that a release needs when the release branch is pushed. The new Release workflow finds those runs for the tagged commit, waits for them, and collects their nine files into a draft release. It builds nothing, so what ships is what was tested. The release notes come from the CHANGELOG.md entry for that version. Signed-off-by: Ron Evans <ron@hybridgroup.com>
36 lines
696 B
Bash
Executable File
36 lines
696 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Print the CHANGELOG.md entry for one version, to use as release notes.
|
|
# The file uses a setext heading: the bare version, then a line of dashes.
|
|
|
|
set -e
|
|
|
|
version="$1"
|
|
if [ -z "$version" ]; then
|
|
echo "usage: $0 <version>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
notes=$(awk -v version="$version" '
|
|
found {
|
|
if ($0 ~ /^---+$/ && previous != "") { previous = ""; exit }
|
|
if (previous != "") print previous
|
|
previous = $0
|
|
next
|
|
}
|
|
$0 ~ /^---+$/ && previous == version {
|
|
found = 1
|
|
previous = ""
|
|
next
|
|
}
|
|
{ previous = $0 }
|
|
END { if (found && previous != "") print previous }
|
|
' CHANGELOG.md)
|
|
|
|
if [ -z "$notes" ]; then
|
|
echo "no CHANGELOG.md entry for version $version" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "$notes"
|