Skip to content

Commit

Permalink
Merge pull request #336 from fboundy/patch
Browse files Browse the repository at this point in the history
Updated workflows
  • Loading branch information
fboundy authored Dec 31, 2024
2 parents bf39c3a + 1f18723 commit 1a86dc8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/auto_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
fi
echo "main_version=$VERSION" >> $GITHUB_ENV
- name: Validate version increment
id: validate_version
- name: Validate or Fix Version Increment
id: validate_or_fix_version
run: |
patch_version=$patch_version
main_version=$main_version
Expand All @@ -54,21 +54,23 @@ jobs:
# Check if the patch version is incremented correctly
if [ "$patch_patch" -ne $((main_patch + 1)) ]; then
echo "Error: PATCH version is not incremented correctly." >&2
echo "Main version: $main_version, Patch version: $patch_version" >&2
exit 1
echo "Warning: PATCH version is not incremented correctly. Fixing..."
new_patch_version=$(echo "$main_version" | awk -F '.' '{print $1"."$2"."($3+1)}')
sed -i "s/^VERSION = \".*\"/VERSION = \"$new_patch_version\"/" apps/pv_opt/pv_opt.py
echo "Corrected version to $new_patch_version."
echo "patch_version=$new_patch_version" >> $GITHUB_ENV
fi
- name: Update README.md version
run: |
sed -i "1s/v[0-9]*\.[0-9]*\.[0-9]*/v$patch_version/" README.md
- name: Commit README.md changes
- name: Commit Changes if Needed
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add README.md
git commit -m "Update README.md version to $patch_version"
git add apps/pv_opt/pv_opt.py README.md
git diff --cached --quiet || git commit -m "Fix version and update README.md to $patch_version"
- name: Push changes back to patch branch
run: |
Expand Down

0 comments on commit 1a86dc8

Please sign in to comment.