1010 setup :
1111 if : github.repository_owner == 'galaxyproject'
1212 runs-on : ubuntu-latest
13- environment : create-release
1413
1514 # This is only needed for the final step of gh release creation.
1615 # That should be separated into a separate dependent job at some point.
@@ -35,12 +34,75 @@ jobs:
3534 run : |
3635 git tag -l
3736
37+ - uses : actions/setup-python@v7
38+ with :
39+ python-version : ' 3.11'
40+
41+ - name : Generate Release Notes
42+ run : |
43+ # Find the previous tag to compute the date range
44+ PREV_TAG=$(git tag -l --sort=-version:refname | head -1)
45+ if [ -z "$PREV_TAG" ]; then
46+ # No previous tag: look back 30 days
47+ SINCE=$(date -d '30 days ago' --iso-8601=seconds)
48+ else
49+ SINCE=$(git log -1 --format=%aI "$PREV_TAG")
50+ fi
51+
52+ {
53+ # Release header with archive link
54+ echo "## Galaxy Codex Monthly Release"
55+ echo ""
56+ echo "Monthly release of Galaxy Codex is now [available on GitHub](https://github.com/galaxyproject/galaxy_codex/releases/tag/${RELEASE_TAG})."
57+ echo ""
58+
59+ # Resource stats from script
60+ python3 sources/bin/collect_release_stats.py --ref "$PREV_TAG" | tail -n +3
61+ echo ""
62+
63+ # Git activity summary
64+ echo "### Activity Summary"
65+ echo ""
66+ COMMITS=$(git log --since="$SINCE" --oneline --no-merges | wc -l)
67+ echo "- **${COMMITS} commits** merged"
68+ echo ""
69+
70+ # Merged PRs: only "Merge pull request #" commits
71+ echo "### Pull Requests Merged"
72+ echo ""
73+ git log --since="$SINCE" --merges --oneline --grep="Merge pull request" | while IFS= read -r line; do
74+ MSG=$(echo "$line" | sed 's/^.*Merge pull request //')
75+ echo "- ${MSG}"
76+ done
77+ echo ""
78+
79+ # Per-community file changes
80+ echo "### Community File Changes"
81+ echo ""
82+ for community_dir in communities/*/; do
83+ community=$(basename "$community_dir")
84+ [ "$community" = "all" ] && continue
85+ [ "$community" = "README.md" ] && continue
86+ CHANGED=$(git log --since="$SINCE" --name-only --pretty=format: -- "$community_dir" | grep -c . || true)
87+ if [ "$CHANGED" -gt 0 ]; then
88+ echo "- **${community}**: ${CHANGED} files updated"
89+ fi
90+ done
91+ echo ""
92+
93+ echo "---"
94+ echo "*Browse the full catalog: https://galaxyproject.github.io/galaxy_codex/*"
95+ } > /tmp/last-month-on.md
96+
97+ echo "Generated release notes:"
98+ cat /tmp/last-month-on.md
99+
38100 - name : Create Release
39101 id : create_release
40102 env :
41- GH_TOKEN : ${{ secrets.GH_TOKEN }}
103+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
42104 RELEASE_TAG : ${{ env.release_tag }}
43105 RELEASE_TITLE : ${{ env.release_title }}
44106 run : |
45107 # Create the release
46- gh release create "$RELEASE_TAG" --title "Release $RELEASE_TITLE" --notes-file /tmp/last-month-on.md --target main --latest
108+ gh release create "$RELEASE_TAG" --title "Release $RELEASE_TITLE" --notes-file /tmp/last-month-on.md --target main --latest
0 commit comments