Shimmy v1.5.4 - CUDA Version Fix #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Changelog | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to add to changelog (e.g., 1.3.3)' | |
required: true | |
release_notes: | |
description: 'Release notes (markdown format)' | |
required: true | |
jobs: | |
update-changelog: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fetch-depth: 0 | |
- name: Set up Git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Extract version and date | |
id: extract | |
run: | | |
if [ "${{ github.event_name }}" = "release" ]; then | |
VERSION="${{ github.event.release.tag_name }}" | |
RELEASE_NOTES="${{ github.event.release.body }}" | |
else | |
VERSION="${{ github.event.inputs.version }}" | |
RELEASE_NOTES="${{ github.event.inputs.release_notes }}" | |
fi | |
# Remove 'v' prefix if present | |
VERSION=${VERSION#v} | |
# Get current date | |
DATE=$(date +%Y-%m-%d) | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
echo "date=$DATE" >> $GITHUB_OUTPUT | |
echo "release_notes<<EOF" >> $GITHUB_OUTPUT | |
echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
- name: Update CHANGELOG.md | |
run: | | |
VERSION="${{ steps.extract.outputs.version }}" | |
DATE="${{ steps.extract.outputs.date }}" | |
RELEASE_NOTES="${{ steps.extract.outputs.release_notes }}" | |
# Create temporary file with new entry | |
cat > new_entry.md << EOF | |
## [$VERSION] - $DATE | |
$RELEASE_NOTES | |
EOF | |
# Insert new entry after "## [Unreleased]" line | |
awk ' | |
/^## \[Unreleased\]/ { | |
print $0 | |
print "" | |
while ((getline line < "new_entry.md") > 0) { | |
print line | |
} | |
close("new_entry.md") | |
next | |
} | |
{print} | |
' CHANGELOG.md > CHANGELOG_new.md | |
# Replace original file | |
mv CHANGELOG_new.md CHANGELOG.md | |
rm -f new_entry.md | |
- name: Update version links at bottom | |
run: | | |
VERSION="${{ steps.extract.outputs.version }}" | |
# Add new version link at the end of file | |
echo "" >> CHANGELOG.md | |
echo "[${VERSION}]: https://github.com/Michael-A-Kuykendall/shimmy/releases/tag/v${VERSION}" >> CHANGELOG.md | |
- name: Commit and push changes | |
run: | | |
VERSION="${{ steps.extract.outputs.version }}" | |
if git diff --quiet CHANGELOG.md; then | |
echo "No changes to CHANGELOG.md" | |
exit 0 | |
fi | |
git add CHANGELOG.md | |
git commit -m "docs: Update CHANGELOG.md for v$VERSION release | |
🤖 Generated with [Claude Code](https://claude.ai/code) | |
Co-Authored-By: Claude <[email protected]>" | |
git push origin main | |
- name: Create PR if push fails | |
if: failure() | |
run: | | |
VERSION="${{ steps.extract.outputs.version }}" | |
BRANCH_NAME="changelog/v$VERSION" | |
git checkout -b "$BRANCH_NAME" | |
git push origin "$BRANCH_NAME" | |
gh pr create \ | |
--title "docs: Update CHANGELOG.md for v$VERSION" \ | |
--body "Automated changelog update for release v$VERSION | |
This PR was automatically generated by the changelog update workflow. | |
🤖 Generated with [Claude Code](https://claude.ai/code)" \ | |
--base main \ | |
--head "$BRANCH_NAME" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |