Skip to content
Merged
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
45 changes: 43 additions & 2 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:

- name: Generate release notes
id: release_notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME="${{ github.ref_name }}"
VERSION="${{ steps.validate.outputs.version }}"
Expand All @@ -67,11 +69,50 @@ jobs:

echo "Generating release notes from $PREV_TAG to $TAG_NAME"

# Get list of merged PRs between tags
echo "Fetching merged PRs..."
PR_LIST=""

# Get merge commits between previous tag and current tag
MERGE_COMMITS=$(git log ${PREV_TAG}..${TAG_NAME} --merges --pretty=format:"%H %s" | grep "Merge pull request #")

if [ -n "$MERGE_COMMITS" ]; then
while IFS= read -r commit_line; do
# Extract PR number from commit message (format: "Merge pull request #123 from ...")
PR_NUMBER=$(echo "$commit_line" | sed -n 's/.*Merge pull request #\([0-9]*\).*/\1/p')

if [ -n "$PR_NUMBER" ]; then
# Fetch PR details from GitHub API
PR_DATA=$(gh pr view "$PR_NUMBER" --json title,author --jq '{title: .title, author: .author.login}')
PR_TITLE=$(echo "$PR_DATA" | jq -r '.title')
PR_AUTHOR=$(echo "$PR_DATA" | jq -r '.author')

# Add to PR list
PR_LIST="${PR_LIST}- ${PR_TITLE} by @${PR_AUTHOR} in [#${PR_NUMBER}](https://github.com/${{ github.repository }}/pull/${PR_NUMBER})"$'\n'
fi
done <<< "$MERGE_COMMITS"
fi

# Generate basic release notes
cat > release_notes.md << EOF
## Release $VERSION

**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${TAG_NAME}
### What's Changed

EOF

# Add PR list if available
if [ -n "$PR_LIST" ]; then
echo "$PR_LIST" >> release_notes.md
echo "" >> release_notes.md
else
echo "No merged pull requests found in this release." >> release_notes.md
echo "" >> release_notes.md
fi

# Add full changelog link
cat >> release_notes.md << EOF
**Full Changelog**: [${PREV_TAG}...${TAG_NAME}](https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${TAG_NAME})

### Artifacts

Expand Down Expand Up @@ -105,7 +146,7 @@ jobs:
VERSION="${{ steps.validate.outputs.version }}"

gh release create "$TAG_NAME" \
--title "$VERSION" \
--title "$TAG_NAME" \
--notes-file "${{ steps.release_notes.outputs.release_notes_file }}" \
--draft=false \
--prerelease=false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/auto-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Clear git credentials
if: steps.check.outputs.is_version_bump == 'true' && steps.check_label.outputs.skip_tag == 'false'
run: |
git config --unset-all http.https://github.com/.extraheader || true
git config --global --unset-all credential.helper || true
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME="${{ github.event.release.tag_name }}"
gh release upload "$TAG_NAME" \
./artifacts/bootstrap.zip#rotel-lambda-forwarder-${TAG_NAME}_${{ matrix.arch }}.zip
id=$(gh api -H "Accept: application/vnd.github+json" /repos/${{ github.repository }}/releases/tags/${{ github.event.release.tag_name }} --jq .id)
curl --fail-with-body -sS -X POST --data-binary @"./artifacts/bootstrap.zip" -H 'Content-Type: application/octet-stream' -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://uploads.github.com/repos/${{ github.repository }}/releases/$id/assets?name=rotel-lambda-forwarder-${{ github.event.release.tag_name }}_${{ matrix.arch }}.zip"

upload-cloudformation:
name: upload cloudformation - ${{ matrix.arch }}
Expand Down