Skip to content
Merged
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
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,54 @@ jobs:
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "✅ Version updated: ${{ steps.current_version.outputs.version }} → $NEW_VERSION"

- name: Collect release commits
id: release_commits
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
REPO: ${{ github.repository }}
PREV_VERSION: ${{ steps.current_version.outputs.version }}
run: |
PREV_TAG="v${PREV_VERSION}"
if git rev-parse "$PREV_TAG" >/dev/null 2>&1; then
RANGE="$PREV_TAG..HEAD"
else
RANGE="HEAD"
echo "Previous tag $PREV_TAG not found; using full history."
fi

COMMITS=$(git log --pretty=format:'%H|%h|%s' "$RANGE")
if [ -z "$COMMITS" ]; then
{
echo "markdown<<EOF"
echo "- No new commits found."
echo "EOF"
} >> "$GITHUB_OUTPUT"
exit 0
fi

NOTES_FILE=$(mktemp)
while IFS='|' read -r COMMIT_SHA COMMIT_SHORT COMMIT_SUBJECT; do
PR_JSON=$(curl -sS \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$REPO/commits/$COMMIT_SHA/pulls" || echo "[]")

PR_NUMBER=$(echo "$PR_JSON" | jq -r '.[0].number // empty')
PR_URL=$(echo "$PR_JSON" | jq -r '.[0].html_url // empty')

if [ -n "$PR_NUMBER" ] && [ -n "$PR_URL" ]; then
echo "- [\`$COMMIT_SHORT\`](https://github.com/$REPO/commit/$COMMIT_SHA) $COMMIT_SUBJECT ([#${PR_NUMBER}]($PR_URL))" >> "$NOTES_FILE"
else
echo "- [\`$COMMIT_SHORT\`](https://github.com/$REPO/commit/$COMMIT_SHA) $COMMIT_SUBJECT" >> "$NOTES_FILE"
fi
done <<< "$COMMITS"

{
echo "markdown<<EOF"
cat "$NOTES_FILE"
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Build package
run: |
echo "🔄 Building package..."
Expand Down Expand Up @@ -198,6 +246,9 @@ jobs:
echo "- **Target**: PyPI" >> $GITHUB_STEP_SUMMARY
echo "- **Dry Run**: ${{ inputs.dry_run }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🧾 New Commits" >> $GITHUB_STEP_SUMMARY
printf '%s\n' "${{ steps.release_commits.outputs.markdown }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ "${{ inputs.dry_run }}" = "false" ]; then
echo "### 📦 Package Links" >> $GITHUB_STEP_SUMMARY
Expand Down