Compare commits

...

1 Commits

Author SHA1 Message Date
Christopher Haster
64f3c78dc5 Added generations of contributors/sponsors in release notes
GitHub makes this kind of difficult, the best route seems to just scrape
the undocumented "sponsors_partial" page? Seems like a strange thing to
omit from the REST API.

At least contributors are relatively easy, thanks to GitHub's email ->
username REST API. Though this does result in an unbounded number of
REST queries...
2023-12-21 22:41:54 -06:00

View File

@@ -210,9 +210,60 @@ jobs:
--format="format:[\`%h\`](`
`https://github.com/$GITHUB_REPOSITORY/commit/%h) %s" \
> changes.txt
echo "CHANGES:"
echo >> changes.txt
cat changes.txt
# find contributors from history/GitHub
- name: create-contributors
run: |
touch contributors_.txt
for email in $( \
git log "$LFS_PREV_VERSION.." \
--grep='^Merge' --invert-grep \
--format="%ae" \
| sort \
| uniq )
do
curl -sS "$GITHUB_API_URL/search/users?q=$email" \
| jq -r '"@"+.items[0].login' >> contributors_.txt || true
done
grep '@' contributors_.txt || exit 0
# format
echo "### Contributors" >> contributors.txt
echo >> contributors.txt
echo -n "A special thanks to all who proposed PRs: " >> contributors.txt
sed -z -e 's/\n/, /g' -e 's/, $/\n/g' contributors_.txt >> contributors.txt
cat contributors.txt
# find sponsors from GitHub
- name: create-sponsors
run: |
[ -n "${{vars.SPONSORS_URL}}" ] || exit 0
touch sponsors_.txt
for ((i=1;; i++))
do
# SPONSORS_URL should be something like
# https://github.com/sponsors/<org>/sponsors_partial?filter=<active|inactive|all>
curl -sS "${{vars.SPONSORS_URL}}&page=$i" \
| grep -o '"@[^"]*"' \
| sed 's/"//g' \
| grep '@' >> sponsors_.txt || break
done
grep '@' sponsors_.txt || exit 0
# format
echo "### Sponsors" >> sponsors.txt
echo >> sponsors.txt
echo -n "A special thanks to littlefs's sponsors: " >> sponsors.txt
sed -z -e 's/\n/, /g' -e 's/, $/\n/g' sponsors_.txt >> sponsors.txt
cat sponsors.txt
# create and update major branches (vN and vN-prefix)
- name: create-major-branches
run: |
@@ -242,10 +293,15 @@ jobs:
run: |
# create release and patch version tag (vN.N.N)
# only draft if not a patch release
touch release.txt
echo "### Changes" >> release.txt
echo >> release.txt
[ -e table.txt ] && cat table.txt >> release.txt
echo >> release.txt
[ -e changes.txt ] && cat changes.txt >> release.txt
echo >> release.txt
[ -e contributors.txt ] && cat contributors.txt >> release.txt
echo >> release.txt
[ -e sponsors.txt ] && cat sponsors.txt >> release.txt
cat release.txt
curl -sS -X POST -H "authorization: token ${{secrets.BOT_TOKEN}}" \