diff --git a/devtools/credit b/devtools/credit index 6036c115fc79..88dbe88b9aed 100755 --- a/devtools/credit +++ b/devtools/credit @@ -1,28 +1,60 @@ #! /bin/sh VERBOSE=false +MARKDOWN=false -if [ x"$1" = x"--verbose" ]; then - VERBOSE=true +while [ $# -gt 0 ]; do + case "$1" in + --verbose) + VERBOSE=true + ;; + --markdown) + MARKDOWN=true + ;; + -*) + echo "Usage: $0 [--verbose] [--markdown] " >&2 + exit 1 + ;; + *) + if [ -n "$PREV_TAG" ]; then + echo "Usage: $0 [--verbose] [--markdown] " >&2 + exit 1 + fi + PREV_TAG="$1" + ;; + esac shift -fi +done -if [ "$#" != 1 ]; then - echo "Usage: $0 [--verbose] " >&2 +if [ -z "$PREV_TAG" ]; then + echo "Usage: $0 [--verbose] [--markdown] " >&2 exit 1 fi -PREV_TAG="$1" -if [ -z $(git tag -l "$PREV_TAG") ]; then - echo "Error: couldn't find tag '$PREV_TAG'!" +if [ -z "$(git tag -l "$PREV_TAG")" ]; then + echo "Error: couldn't find tag '$PREV_TAG'!" >&2 exit 1 fi + +# Avoid ambiguity with branch names like v26.04. +if git show-ref --tags --quiet --verify "refs/tags/$PREV_TAG"; then + PREV_TAG="refs/tags/$PREV_TAG" +fi + git log "$PREV_TAG".. --format="%an|%ae" | sort | uniq -c | sort -rn > /tmp/authors.$$ sed -n 's/.*[Nn]amed by //p' < CHANGELOG.md | sed 's/(.*)//' | tr -dc '[:alnum:][:space:]' > /tmp/namers.$$ git log "$PREV_TAG" --format="%an|%ae" | sort -u > /tmp/prev-authors.$$ # Include aliases printf "Alex Myers\nShahanaFarooqui\nMatt Whitlock\nSangbida Chaudhuri\n" >> /tmp/namers.$$ +display_tag=${PREV_TAG#refs/tags/} +if $MARKDOWN; then + MARKDOWN_OUT=/tmp/markdown.$$ + NEWCOMMITTERS_OUT=/tmp/newcommitters.$$ + : > "$MARKDOWN_OUT" + : > "$NEWCOMMITTERS_OUT" +fi + NAMER="" BACKUP_NAMER="" TOTAL=0 @@ -33,7 +65,7 @@ while read LINE; do NAME=${LINE%%|*} EMAIL=${LINE#*|} NOTES="" - if [ $(grep -ci -- "$NAME\|$EMAIL" /tmp/prev-authors.$$) = 0 ]; then + if [ "$(grep -ci -- "$NAME\|$EMAIL" /tmp/prev-authors.$$)" = 0 ]; then NOTES="$NOTES""NEW COMMITTER " fi # ZmnSCPxj gave himself a surname! @@ -49,13 +81,45 @@ while read LINE; do NOTES="$NOTES""*BACKUP NAMER* " fi fi - if [ -n "$NOTES" ] || $VERBOSE; then + if $MARKDOWN; then + case "$EMAIL" in + *@users.noreply.github.com) + HANDLE=$(echo "$EMAIL" | sed -n 's/.*+\([^@]*\)@users.noreply.github.com/\1/p') + if [ -z "$HANDLE" ]; then + HANDLE=$(echo "$EMAIL" | sed 's/@users.noreply.github.com//') + fi + DISPLAY="@$HANDLE" + ;; + *) + DISPLAY="$NAME" + ;; + esac + if echo "$NOTES" | grep -q "NEW COMMITTER"; then + echo "- $DISPLAY ($COUNT commits)" >> "$NEWCOMMITTERS_OUT" + fi + echo "- $DISPLAY ($COUNT commits)" >> "$MARKDOWN_OUT" + elif [ -n "$NOTES" ] || $VERBOSE; then echo " - $COUNT $NAME $EMAIL $NOTES" fi done < /tmp/authors.$$ DAYS=$(( ( $(date +%s) - $(git log "$PREV_TAG" --format=%at | head -n1) ) / (3600*24) )) -AUTHORS=$(cat /tmp/authors.$$ | wc -l) -echo "$TOTAL commits in $DAYS days by $AUTHORS authors" +AUTHORS=$(wc -l < /tmp/authors.$$ | tr -d ' ') +if $MARKDOWN; then + echo "## Since **$display_tag** we've had $TOTAL commits in $DAYS days by $AUTHORS authors" + echo + echo "### Contributors" + echo + cat "$MARKDOWN_OUT" + if [ -s "$NEWCOMMITTERS_OUT" ]; then + echo + echo "### Special thanks to our first-time contributors" + echo + cat "$NEWCOMMITTERS_OUT" + fi + rm "$MARKDOWN_OUT" "$NEWCOMMITTERS_OUT" +else + echo "$TOTAL commits in $DAYS days by $AUTHORS authors" +fi rm /tmp/authors.$$ /tmp/namers.$$ /tmp/prev-authors.$$ diff --git a/doc/contribute-to-core-lightning/release-checklist.md b/doc/contribute-to-core-lightning/release-checklist.md index c1bcaef644bd..a3222c13bfd1 100644 --- a/doc/contribute-to-core-lightning/release-checklist.md +++ b/doc/contribute-to-core-lightning/release-checklist.md @@ -36,8 +36,8 @@ Here's a checklist for the release process. 6. Push the tag to trigger the "Release 🚀" CI action, which drafts a new `vrc1` pre-release on GitHub and uploads reproducible builds alongside the `SHA256SUMS-v` file and its signature from the `cln@blockstream.com` key. 7. Verify your local `SHA256SUMS-v` file matches the one in the draft release, then append your local signatures to the release's `SHA256SUMS-v.asc` file to attest to the build's integrity. 8. Announce rc1 release on core-lightning's release-chat channel on Discord & Telegram. -9. Use `devtools/credit --verbose v` to get commits, days and contributors data for release note. -10. Prepare release notes draft including information from above step, and share with the team for editing. +9. Use `devtools/credit --markdown v` to generate a single contributor list for the release notes. Use `devtools/credit --verbose v` for namer selection and detailed annotations. +10. Prepare release notes draft including the contributor list from above, and share with the team for editing. 11. Upgrade your personal nodes to the rc1, to help testing. 12. Github action `Publish Python 🐍 distributions 📦 to PyPI and TestPyPI` uploads the pyln modules on test PyPI server. Make sure that the action has been triggered with RC tag and that the modules have been published on `https://test.pypi.org/project/pyln-*/#history`. 13. Docker image publishing is handled by the GitHub action `Build and push multi-platform docker images`. Ensure that this action is triggered and that the RC image has been successfully uploaded to Docker Hub after the action completes. Alternatively, you can publish Docker images by running the `tools/build-release.sh docker` script. The GitHub action takes approximately 3-4 hours, while the script takes about 6-7 hours. It is highly recommended to test your Docker setup if you haven't done so before. Prior to building docker images by `tools/build-release.sh` script, ensure that `multiarch/qemu-user-static` setup is working on your system as described [here](https://docs.corelightning.org/docs/docker-images#setting-up-multiarchqemu-user-static).