Skip to content

Commit 5053773

Browse files
authored
chore: Add Sentry Android Gradle Plugin update automation (#968)
* Add Sentry Android Gradle Plugin update automation * Remove manual triggering * Change update script file mode
1 parent 12822e1 commit 5053773

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

.github/workflows/update-dependencies.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,13 @@ jobs:
3939
with:
4040
path: plugin-dev/sentry-cli.properties
4141
name: CLI
42+
secrets:
43+
api-token: ${{ secrets.CI_DEPLOY_KEY }}
44+
45+
android-gradle-plugin:
46+
uses: getsentry/github-workflows/.github/workflows/updater.yml@v2
47+
with:
48+
path: scripts/update-android-gradle-plugin.sh
49+
name: Android Gradle Plugin
4250
secrets:
4351
api-token: ${{ secrets.CI_DEPLOY_KEY }}

plugin-dev/Source/Sentry/Sentry_Android_UPL.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
<insert>
176176
dependencies {
177177
classpath 'com.android.tools.build:gradle:3.5.4'
178-
classpath 'io.sentry:sentry-android-gradle-plugin:2.1.5'
178+
classpath 'io.sentry:sentry-android-gradle-plugin:2.1.5' // legacy
179179
}
180180
</insert>
181181
</true>
@@ -185,7 +185,7 @@
185185
<insert>
186186
dependencies {
187187
classpath 'com.android.tools.build:gradle:7.4.2'
188-
classpath 'io.sentry:sentry-android-gradle-plugin:4.11.0'
188+
classpath 'io.sentry:sentry-android-gradle-plugin:4.11.0' // current
189189
}
190190
</insert>
191191
</false>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
cd $(dirname "$0")/../
5+
ANDROID_UPL_FILEPATH=plugin-dev/Source/Sentry/Sentry_Android_UPL.xml
6+
7+
case $1 in
8+
get-version)
9+
perl -ne 'print "$1\n" if ( m/io\.sentry:sentry-android-gradle-plugin:([0-9.]+).*\/\/ current/ )' $ANDROID_UPL_FILEPATH
10+
;;
11+
get-repo)
12+
echo "https://github.com/getsentry/sentry-android-gradle-plugin.git"
13+
;;
14+
set-version)
15+
version=$2
16+
17+
echo "Setting Android Gradle Plugin version to '$version'"
18+
19+
PATTERN="io\.sentry:sentry-android-gradle-plugin:([0-9.]+).*\/\/ current"
20+
perl -pi -e "s/$PATTERN/io.sentry:sentry-android-gradle-plugin:$version \/\/ current/g" $ANDROID_UPL_FILEPATH
21+
;;
22+
*)
23+
echo "Unknown argument $1"
24+
exit 1
25+
;;
26+
esac

0 commit comments

Comments
 (0)