Skip to content

Commit

Permalink
ci: automatic sentry-java SDK dependency upate (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Jun 29, 2022
1 parent c84c950 commit e84dc8f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/update-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ jobs:
# If a custom token is used instead, a CI would be triggered on a created PR.
# api_token: ${{ secrets.CI_DEPLOY_KEY }}
api_token: ${{ github.token }}

android:
uses: getsentry/github-workflows/.github/workflows/updater.yml@v1
with:
path: scripts/update-android.sh
name: Android SDK
secrets:
# If a custom token is used instead, a CI would be triggered on a created PR.
# api_token: ${{ secrets.CI_DEPLOY_KEY }}
api_token: ${{ github.token }}
28 changes: 28 additions & 0 deletions scripts/update-android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail

cd $(dirname "$0")/../
file='plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryPlugin.kt'
content=$(cat $file)
regex='(SENTRY_SDK_VERSION *= *)"([0-9\.]+)"'
if ! [[ $content =~ $regex ]]; then
echo "Failed to find the Android SDK version in $file"
exit 1
fi

case $1 in
get-version)
echo ${BASH_REMATCH[2]}
;;
get-repo)
echo "https://github.com/getsentry/sentry-java.git"
;;
set-version)
newValue="${BASH_REMATCH[1]}\"$2\""
echo "${content/${BASH_REMATCH[0]}/$newValue}" >$file
;;
*)
echo "Unknown argument $1"
exit 1
;;
esac

0 comments on commit e84dc8f

Please sign in to comment.