Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Update Version Workflow #380

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
15 changes: 9 additions & 6 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,22 @@ jobs:
- name: Update dev version
run: |
git fetch --prune --unshallow --tags
tags="$(git tag --list)"
latest_tag=${tags: -6 : 6}
old_version=${latest_tag:1:5}
IFS=$'\n' read -rd '' -a tags <<<"$(git tag --list --sort version:refname)"
echo $tags
latest_tag=${y[${#y[@]} - 1]}
old_version="${latest_tag:1}"
echo "Old Version: $old_version"
old_major_version=${old_version:0:1}
old_minor_version=${old_version:2:1}
old_patch_version=${old_version:4:1}
IFS=$'.' read -rd '' -a split_old_version <<<"$old_version"
old_major_version=${split_old_version[0]}
old_minor_version=${split_old_version[1]}
old_patch_version=${split_old_version[2]}
new_patch_version=`expr $old_patch_version + 1`
new_version="$old_major_version.$old_minor_version.$new_patch_version"
echo "New Version: $new_version"
sed -i -e "s/version=\"$old_version\"/version=\"$new_version\"/g" setup.py
echo "old_version=$old_version" >> "$GITHUB_ENV"
echo "new_version=$new_version" >> "$GITHUB_ENV"
shell: bash
- name: Commit Changes and Create Pull Request
run: |
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
Expand Down
Loading