Skip to content

Commit

Permalink
[ci] Create a non-draft release from annotated tag
Browse files Browse the repository at this point in the history
If a git tag was annotated, assume that it contains full release notes
and make a public release rather than a draft one.
  • Loading branch information
mislav committed Oct 3, 2019
1 parent ca7dab4 commit 61b81bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions script/github-release
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ while read -r filename label; do
assets+=( -a "${filename}#${label}" )
done

notes="$(git tag --list "v${version}" --format='%(contents:subject)%0a%0a%(contents:body)')"

if hub release --include-drafts | grep -q "^v${version}\$"; then
hub release edit "v${version}" -m "" "${assets[@]}"
elif [ $(wc -l <<<"$notes") -gt 1 ]; then
hub release create ${pre:+--prerelease} -F - "v${version}" "${assets[@]}" <<<"$notes"
else
{ echo "${project_name} ${version}"
echo
Expand Down

0 comments on commit 61b81bd

Please sign in to comment.