2024-02-26 14:05:53 +03:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2024-03-29 18:56:51 +03:00
|
|
|
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
# SPDX-FileCopyrightText: 2024 Tobias Kaminsky <tobias@kaminsky.me>
|
2024-04-30 13:16:39 +03:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
|
2024-02-26 14:05:53 +03:00
|
|
|
|
|
|
|
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'"')
|
|
|
|
|
2024-02-26 15:55:57 +03:00
|
|
|
git fetch
|
|
|
|
git checkout master
|
|
|
|
git pull
|
|
|
|
|
2024-02-26 14:05:53 +03:00
|
|
|
[[ $latestCommit == "$currentCommit" ]] && 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
|
2024-04-23 12:31:39 +03:00
|
|
|
git commit -s -m "Update library to $(date +%F)"
|
|
|
|
|
|
|
|
git push -u origin HEAD
|
|
|
|
gh pr create --fill
|