Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 76 additions & 12 deletions devtools/credit
Original file line number Diff line number Diff line change
@@ -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] <last-tag>" >&2
exit 1
;;
*)
if [ -n "$PREV_TAG" ]; then
echo "Usage: $0 [--verbose] [--markdown] <last-tag>" >&2
exit 1
fi
PREV_TAG="$1"
;;
esac
shift
fi
done

if [ "$#" != 1 ]; then
echo "Usage: $0 [--verbose] <last-tag>" >&2
if [ -z "$PREV_TAG" ]; then
echo "Usage: $0 [--verbose] [--markdown] <last-tag>" >&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
Expand All @@ -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!
Expand All @@ -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.$$
4 changes: 2 additions & 2 deletions doc/contribute-to-core-lightning/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `v<VERSION>rc1` pre-release on GitHub and uploads reproducible builds alongside the `SHA256SUMS-v<VERSION>` file and its signature from the `cln@blockstream.com` key.
7. Verify your local `SHA256SUMS-v<VERSION>` file matches the one in the draft release, then append your local signatures to the release's `SHA256SUMS-v<VERSION>.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<PREVIOUS-VERSION>` 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<PREVIOUS-VERSION>` to generate a single contributor list for the release notes. Use `devtools/credit --verbose v<PREVIOUS-VERSION>` 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).
Expand Down
Loading