Skip to content

Commit

Permalink
Update sdk ios 5.4.0 android 7.4.0 (#22)
Browse files Browse the repository at this point in the history
Add SDK update automatization.
  • Loading branch information
pavel-kuznetsov-hypertrack authored Jan 31, 2024
1 parent 471af18 commit 3923476
Show file tree
Hide file tree
Showing 22 changed files with 302 additions and 197 deletions.
8 changes: 0 additions & 8 deletions .justfile

This file was deleted.

28 changes: 19 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.1.0] - 2024-01-31

### Changed

- Updated HyperTrack SDK iOS to [5.4.0](https://github.com/hypertrack/sdk-ios/releases/tag/5.4.0)
- Updated HyperTrack SDK Android to [7.4.0](https://github.com/hypertrack/sdk-android/releases/tag/7.4.0)

## [3.0.2] - 2024-01-18

### Changed
Expand Down Expand Up @@ -117,13 +126,14 @@ We are excited to announce the release of HyperTrack Ionic Capacitor SDK 2.0.0,

- Initial release

[3.0.2]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/3.0.2
[3.0.1]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/3.0.1
[3.0.0]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/3.0.0
[2.0.2]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/2.0.2
[2.0.1]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/2.0.1
[2.0.0]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/2.0.0
[1.0.3]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/1.0.3
[1.0.2]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/1.0.2
[1.0.1]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/1.0.1
[1.0.0]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/1.0.0
[1.0.1]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/1.0.1
[1.0.2]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/1.0.2
[1.0.3]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/1.0.3
[2.0.0]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/2.0.0
[2.0.1]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/2.0.1
[2.0.2]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/2.0.2
[3.0.0]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/3.0.0
[3.0.1]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/3.0.1
[3.0.2]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/3.0.2
[3.1.0]: https://github.com/hypertrack/sdk-ionic-capacitor/releases/tag/3.1.0
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![GitHub](https://img.shields.io/github/license/hypertrack/sdk-ionic-capacitor.svg?color=orange)](./LICENSE)
[![npm](https://img.shields.io/npm/v/hypertrack-sdk-ionic-capacitor.svg)](https://www.npmjs.com/package/hypertrack-sdk-ionic-capacitor)
[![iOS SDK](https://img.shields.io/badge/iOS%20SDK-5.2.0-brightgreen.svg)](https://github.com/hypertrack/sdk-ios)
[![Android SDK](https://img.shields.io/badge/Android%20SDK-7.2.0-brightgreen.svg)](https://github.com/hypertrack/sdk-android)
[![iOS SDK](https://img.shields.io/badge/iOS%20SDK-5.4.0-brightgreen.svg)](https://github.com/hypertrack/sdk-ios)
[![Android SDK](https://img.shields.io/badge/Android%20SDK-7.4.0-brightgreen.svg)](https://github.com/hypertrack/sdk-android)

[HyperTrack](https://www.hypertrack.com) lets you add live location tracking to your mobile app. Live location is made available along with ongoing activity, tracking controls and tracking outage with reasons.

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ext {

buildscript {
ext.kotlin_version = "1.7.21"
ext.hypertrack_sdk_version = "7.2.0"
ext.hypertrack_sdk_version = "7.4.0"
ext.firebase_messaging_version = "23.1.1"

repositories {
Expand Down
4 changes: 2 additions & 2 deletions docs/classes/HyperTrack.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/enums/HyperTrackError.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/Subscription.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Errors.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Failure.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Location.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/LocationError.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/LocationWithDeviation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/NotRunning.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Result.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Starting.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Success.html

Large diffs are not rendered by default.

176 changes: 176 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# do not create a shorcut for `publish` command to avoid accidental publishing
alias b := build
alias c := clean
alias d := docs
alias gd := get-dependencies
alias od := open-docs
alias pt := push-tag
alias r := release
alias us := update-sdk
alias usa := update-sdk-android
alias usal := update-sdk-android-latest
alias usi := update-sdk-ios
alias usil := update-sdk-ios-latest
alias usl := update-sdk-latest
alias v := version

# Source: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
# \ are escaped
SEMVER_REGEX := "(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?"

# MAKE SURE YOU HAVE
# #!/usr/bin/env sh
# set -e
# AT THE TOP OF YOUR RECIPE
_ask-confirm:
@bash -c 'read confirmation; if [[ $confirmation != "y" && $confirmation != "Y" ]]; then echo "Okay 😮‍💨 😅"; exit 1; fi'

build: get-dependencies
npm run build

clean: _clear-node-modules
rm package-lock.json

_clear-node-modules:
rm -rf node_modules

docs:
npm run docgen

get-dependencies:
npm i

_latest-android:
@curl -s https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/com/hypertrack/sdk-android/maven-metadata-sdk-android.xml | grep latest | grep -o -E '{{SEMVER_REGEX}}' | head -n 1

_latest-ios:
@curl -s https://cocoapods.org/pods/HyperTrack | grep -m 1 -o -E "HyperTrack <span>{{SEMVER_REGEX}}" | grep -o -E '{{SEMVER_REGEX}}' | head -n 1

open-docs: docs
open docs/index.html

push-tag:
#!/usr/bin/env sh
set -euo pipefail
if [ $(git symbolic-ref --short HEAD) = "master" ] ; then
VERSION=$(just version)
git tag $VERSION
git push origin $VERSION
else
echo "You are not on master branch"
fi
release publish="dry-run": build
#!/usr/bin/env sh
set -euo pipefail
VERSION=$(just version)
if [ {{publish}} = "publish" ]; then
BRANCH=$(git branch --show-current)
if [ $BRANCH != "master" ]; then
echo "You must be on main branch to publish a new version (current branch: $BRANCH))"
exit 1
fi
echo "Are you sure you want to publish version $VERSION? (y/N)"
just _ask-confirm
npm publish
open "https://www.npmjs.com/package/hypertrack-sdk-ionic-capacitor/v/$VERSION"
else
npm publish --dry-run
fi
setup: get-dependencies

_update-readme-android android_version:
./scripts/update_file.sh README.md 'Android\%20SDK-.*-brightgreen.svg' 'Android%20SDK-{{android_version}}-brightgreen.svg'

_update-readme-ios ios_version:
./scripts/update_file.sh README.md 'iOS\%20SDK-.*-brightgreen.svg' 'iOS%20SDK-{{ios_version}}-brightgreen.svg'

update-sdk-latest wrapper_version commit="true" branch="true":
#!/usr/bin/env sh
set -euo pipefail
LATEST_IOS=$(just _latest-ios)
LATEST_ANDROID=$(just _latest-android)
just update-sdk {{wrapper_version}} $LATEST_IOS $LATEST_ANDROID {{commit}} {{branch}}
update-sdk-android-latest wrapper_version commit="true" branch="true":
#!/usr/bin/env sh
set -euo pipefail
LATEST_ANDROID=$(just _latest-android)
just update-sdk-android {{wrapper_version}} $LATEST_ANDROID {{commit}} {{branch}}
update-sdk-ios-latest wrapper_version commit="true" branch="true":
#!/usr/bin/env sh
set -euo pipefail
LATEST_IOS=$(just _latest-ios)
just update-sdk-ios {{wrapper_version}} $LATEST_IOS {{commit}} {{branch}}
update-sdk wrapper_version ios_version android_version commit="true" branch="true": build
#!/usr/bin/env sh
set -euo pipefail
if [ "{{branch}}" = "true" ] ; then
git checkout -b update-sdk-ios-{{ios_version}}-android-{{android_version}}
fi
just version
echo "New version is {{wrapper_version}}"
just _update-wrapper-version-file {{wrapper_version}}
./scripts/update_changelog.sh -w {{wrapper_version}} -i {{ios_version}} -a {{android_version}}
echo "Updating HyperTrack SDK iOS to {{ios_version}}"
just _update-sdk-ios-version-file {{ios_version}}
just _update-readme-ios {{ios_version}}
echo "Updating HyperTrack SDK Android to {{android_version}}"
just _update-sdk-android-version-file {{android_version}}
just _update-readme-android {{android_version}}
just docs
if [ "{{commit}}" = "true" ] ; then
git add .
git commit -m "Update HyperTrack SDK iOS to {{ios_version}} and Android to {{android_version}}"
fi
update-sdk-android wrapper_version android_version commit="true" branch="true": build
#!/usr/bin/env sh
set -euo pipefail
if [ "{{branch}}" = "true" ] ; then
git checkout -b update-sdk-android-{{android_version}}
fi
just version
echo "Updating HyperTrack SDK Android to {{android_version}} on {{wrapper_version}}"
just _update-wrapper-version-file {{wrapper_version}}
just _update-sdk-android-version-file {{android_version}}
just _update-readme-android {{android_version}}
./scripts/update_changelog.sh -w {{wrapper_version}} -a {{android_version}}
just docs
if [ "{{commit}}" = "true" ] ; then
git add .
git commit -m "Update HyperTrack SDK Android to {{android_version}}"
fi
update-sdk-ios wrapper_version ios_version commit="true" branch="true": build
#!/usr/bin/env sh
set -euo pipefail
if [ "{{branch}}" = "true" ] ; then
git checkout -b update-sdk-ios-{{ios_version}}
fi
just version
echo "Updating HyperTrack SDK iOS to {{ios_version}} on {{wrapper_version}}"
just _update-wrapper-version-file {{wrapper_version}}
just _update-sdk-ios-version-file {{ios_version}}
just _update-readme-ios {{ios_version}}
./scripts/update_changelog.sh -w {{wrapper_version}} -i {{ios_version}}
just docs
if [ "{{commit}}" = "true" ] ; then
git add .
git commit -m "Update HyperTrack SDK iOS to {{ios_version}}"
fi
_update-sdk-android-version-file android_version:
./scripts/update_file.sh android/build.gradle 'ext.hypertrack_sdk_version = ".*"' 'ext.hypertrack_sdk_version = "{{android_version}}"'

_update-sdk-ios-version-file ios_version:
./scripts/update_file.sh HypertrackSdkIonicCapacitor.podspec "'HyperTrack', '.*'" "'HyperTrack', '{{ios_version}}'"

_update-wrapper-version-file wrapper_version:
./scripts/update_file.sh package.json '"version": ".*"' '"version": "{{wrapper_version}}"'

version:
@cat package.json | grep version | head -n 1 | grep -o -E '{{SEMVER_REGEX}}'
Loading

0 comments on commit 3923476

Please sign in to comment.