Skip to content

Commit

Permalink
MOB-913 Fix Release Scripts (#102)
Browse files Browse the repository at this point in the history
- updated the release workflow to execute the script from the correct directory
	- Updated the script to have the increment value and to go back to the correct folder to update the podspecs
  • Loading branch information
Peter-John-paystack authored Jan 24, 2024
1 parent 2b4e5ab commit 5a3574e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ jobs:
- name: Increment Latest Version
run: |
mode=${{ github.event.inputs.release }}
sh Sources/PaystackSDK/Versioning/update_version.sh $mode ${{ github.event.inputs.body }}
cd Sources/PaystackSDK
sh Versioning/update_version.sh $mode ${{ github.event.inputs.body }}
- name: Open Pull Request
uses: peter-evans/create-pull-request@v4
Expand Down
5 changes: 3 additions & 2 deletions Sources/PaystackSDK/Versioning/update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ fi

VALUES=($(echo $CURRENT_VERSION | tr . '\n'))
VALUE=VALUES[INDEX]
NEW_VALUE=$((VALUE+1))
INCREMENT=1
NEW_VALUE=$((VALUE + INCREMENT))
VALUES[INDEX]=$NEW_VALUE
if [ $INDEX -lt 2 ]; then VALUES[2]=0; fi
if [ $INDEX -lt 1 ]; then VALUES[1]=0; fi
NEW_VERSION=$(echo $(IFS=. ; echo "${VALUES[*]}"))

/usr/libexec/PlistBuddy -c "Set Version $NEW_VERSION" $PLIST
/usr/libexec/PlistBuddy -c "Set Description $DESCRIPTION" $PLIST

cd ../..
sed -i '' -e "s/.*s.version .*/ s.version = '$NEW_VERSION'/" PaystackCore.podspec
sed -i '' -e "s/.*s.version .*/ s.version = '$NEW_VERSION'/" PaystackUI.podspec

0 comments on commit 5a3574e

Please sign in to comment.