-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
cat Sources/Courier/Courier.swift | while read LINE; do | ||
if [[ $LINE == *"internal static let version"* ]]; then | ||
|
||
# Get version from Courier file | ||
VERSION=$(echo $LINE | sed -e 's/.*"\(.*\)".*/\1/') | ||
|
||
cat Courier-iOS.podspec | while read SPEC_VERSION; do | ||
if [[ $SPEC_VERSION == *"s.version ="* ]]; then | ||
|
||
# Replace PODSPEC version | ||
NEW_SPEC_VERSION="s.version = '$VERSION'" | ||
if [[ $SPEC_VERSION != "" && $NEW_SPEC_VERSION != "" ]]; then | ||
sed -i '.bak' "s/$SPEC_VERSION/$NEW_SPEC_VERSION/g" "Courier-iOS.podspec" | ||
fi | ||
|
||
fi | ||
done | ||
|
||
# Delete backup file | ||
rm "Courier-iOS.podspec.bak" | ||
|
||
# Bump the version | ||
git add . | ||
git commit -m "Bump" | ||
git push | ||
|
||
# Create a new tag with the version and push | ||
git tag $VERSION | ||
git push --tags | ||
|
||
# Ensure github is installed | ||
brew install gh | ||
gh auth login | ||
|
||
# gh release create | ||
gh release create $VERSION --generate-notes | ||
|
||
# Push to pods | ||
pod trunk push | ||
|
||
fi | ||
done |