mirror of
https://github.com/nextcloud/android.git
synced 2024-11-21 20:55:31 +03:00
cfb8306681
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
52 lines
1.6 KiB
Bash
Executable file
52 lines
1.6 KiB
Bash
Executable file
#!/bin/bash
|
|
date=$(date +%Y%m%d)
|
|
|
|
# use current date for version code/name
|
|
sed -i "/versionDev/,/\}/ s/versionCode .*/versionCode $date/" build.gradle
|
|
sed -i "/versionDev/,/\}/ s/versionName .*/versionName \"$date\"/" build.gradle
|
|
|
|
# build signed apk
|
|
./gradlew assembleVersionDevRelease >> /tmp/dev.log 2>&1
|
|
|
|
if [ $? != 0 ] ; then
|
|
echo "Build error!"
|
|
exit 1
|
|
fi
|
|
|
|
# sign
|
|
mkdir -p ~/apks
|
|
|
|
source ~/.gradle/devVersionSecrets
|
|
/home/nextcloud/bin/apksigner sign --ks-pass env:VERSION_DEV_STORE_PASSWORD \
|
|
--key-pass env:VERSION_DEV_KEY_PASSWORD \
|
|
--ks $VERSION_DEV_STORE_FILE \
|
|
--out ~/apks/nextcloud-dev-$date.apk \
|
|
./build/outputs/apk/versionDev/release/versionDev-release-$date.apk
|
|
|
|
# use the current date
|
|
echo $date > ~/apks/latest
|
|
|
|
ln -s nextcloud-dev-$date.apk latest.apk
|
|
mv latest.apk ~/apks/
|
|
|
|
# remove all but the latest 5 apks
|
|
/bin/ls -t ~/apks/*.apk | awk 'NR>6' | xargs rm -f
|
|
|
|
lastBuildTime=$(date --date="$(git log -1 --format=%ai $(git tag | grep dev | tail -n1))" +%s)
|
|
changelog=$(git log --after=$lastBuildTime --pretty=oneline --abbrev-commit)
|
|
|
|
libraryCommit=$(curl https://api.github.com/repos/nextcloud/android-library/commits/master | jq .sha | sed s'/\"//g')
|
|
|
|
# changelog
|
|
echo "$changelog" > src/versionDev/fastlane/metadata/android/en-US/changelogs/$date.txt
|
|
echo "library commit: $libraryCommit" >> src/versionDev/fastlane/metadata/android/en-US/changelogs/$date.txt
|
|
|
|
# build
|
|
sed -i s"# androidLibraryVersion.*#androidLibraryVersion =\"$libraryCommit\"#" build.gradle
|
|
|
|
git add .
|
|
git commit -m "daily dev $date" -m "$changelog"
|
|
git push
|
|
|
|
git tag dev-$date
|
|
git push origin dev-$date
|