mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-31 17:59:03 +00:00
ci: publish a draft release from the artifacts that CI already built
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>
This commit is contained in:
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user