forked from nextcloud/android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdateLibraryHash.sh
executable file
·27 lines (20 loc) · 999 Bytes
/
updateLibraryHash.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2024 Tobias Kaminsky <[email protected]>
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
git fetch
git checkout master
git pull
latestCommit=$(curl -s https://api.github.com/repos/nextcloud/android-library/commits/master | jq .sha | sed s'/\"//g')
currentCommit=$(grep "androidLibraryVersion" build.gradle | cut -f2 -d'"')
[[ $latestCommit == "$currentCommit" ]] && echo "Nothing to do. Commit is: $latestCommit" && exit # nothing to do
git fetch
git checkout -B update-library-"$(date +%F)" origin/master
sed -i s"#androidLibraryVersion\ =.*#androidLibraryVersion =\"$latestCommit\"#" build.gradle
./gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256,pgp help
git add build.gradle
git add gradle/verification-metadata.xml
git commit -s -m "Update library to $(date +%F)"
git push -u origin HEAD
gh pr create --fill