| @@ -33,18 +33,28 @@ case "${TAG}" in |
| 33 | ;; | 33 | ;; |
| 34 | esac | 34 | esac |
| 35 | | 35 | |
| | 36 | +# The notes have the shape of the releases the old workflow published: ABOUT, |
| | 37 | +# the commit, how it was built, a link to the release note when there is one, |
| | 38 | +# and the checksums. |
| 36 | notes_file="release-notes/${TAG}.en.md" | 39 | notes_file="release-notes/${TAG}.en.md" |
| 37 | { | 40 | { |
| | 41 | + printf '%s\n\n' "${ABOUT:-Mini Me}" |
| | 42 | + printf -- '- Commit: `%s`\n' "${head_sha}" |
| | 43 | + printf -- '- Built on a local machine with %s\n' "$(go env GOVERSION)" |
| 38 | if [ -f "${notes_file}" ]; then | 44 | if [ -f "${notes_file}" ]; then |
| 39 | - cat "${notes_file}" | 45 | + printf '\nDetails: https://rickub.com/%s/%s/blob/main/%s\n' "${OWNER}" "${REPO}" "${notes_file}" |
| 40 | - else | | |
| 41 | - printf 'Mini Me %s\n' "${TAG}" | | |
| 42 | fi | 46 | fi |
| 43 | - printf '\n- Commit: `%s`\n- Built on a local machine with %s\n\n## Checksums\n\n```\n' "${head_sha}" "$(go env GOVERSION)" | 47 | + printf '\n## Checksums\n\n```\n' |
| 44 | cat "${assets_dir}/SHA256SUMS" | 48 | cat "${assets_dir}/SHA256SUMS" |
| 45 | printf '```\n' | 49 | printf '```\n' |
| 46 | } > "${work}/notes.md" | 50 | } > "${work}/notes.md" |
| 47 | | 51 | |
| | 52 | +# LOCAL_CI_PRINT_NOTES=1 shows the notes and stops: nothing is created. |
| | 53 | +if [ -n "${LOCAL_CI_PRINT_NOTES:-}" ]; then |
| | 54 | + cat "${work}/notes.md" |
| | 55 | + exit 0 |
| | 56 | +fi |
| | 57 | + |
| 48 | echo "==> creating the draft prerelease ${TAG} on ${head_sha}" | 58 | echo "==> creating the draft prerelease ${TAG} on ${head_sha}" |
| 49 | payload="$(jq -n --arg tag "${TAG}" --arg target "${head_sha}" --rawfile body "${work}/notes.md" \ | 59 | payload="$(jq -n --arg tag "${TAG}" --arg target "${head_sha}" --rawfile body "${work}/notes.md" \ |
| 50 | '{tag: $tag, title: $tag, target: $target, body: $body, prerelease: true, draft: true}')" | 60 | '{tag: $tag, title: $tag, target: $target, body: $body, prerelease: true, draft: true}')" |