[Shellscript] Deploy updates for apps on F-Droid

set -e
echo "Welcome to F-Droid version publisher!"
echo "Press Ctrl+C at any time to abort."

echo "+git status"
git status

echo -n 'new versionCode="..." (integer) '
read vCode
echo -n 'new versionName="..." (string) '
read vName

echo "Change versionCode and versionName in AndroidManifest.xml, then press enter"
echo "+git add AndroidManifest.xml"
git add AndroidManifest.xml || git add app/AndroidManifest.xml

# Generate release notes, let the user edit them and move them to the fastlane changelogs directory
git log $(git describe --tags --abbrev=0)..HEAD --oneline --no-decorate --no-color | cut -d' ' -f2- > F-Droid-new-version-RELEASE-NOTES.txt
nano F-Droid-new-version-RELEASE-NOTES.txt 
echo "cp F-Droid-new-version-RELEASE-NOTES.txt ./fastlane/metadata/android/en-US/changelogs/${vCode}.txt"
cp F-Droid-new-version-RELEASE-NOTES.txt "./fastlane/metadata/android/en-US/changelogs/${vCode}.txt"

echo "+git add fastlane/metadata/android/en-US/changelogs"
git add fastlane/metadata/android/en-US/changelogs/

echo "+git commit -m 'Bump version'"
git commit -m "Bump version"

echo "+git tag -a v${vName} -F F-Droid-new-version-RELEASE-NOTES.txt"
git tag -a "v${vName}" -F F-Droid-new-version-RELEASE-NOTES.txt

echo "Press enter to publish the new version."
echo "+git pull && git push && git push --tags"
git pull && git push && git push --tags

echo "+rm F-Droid-new-version-RELEASE-NOTES.txt"
rm F-Droid-new-version-RELEASE-NOTES.txt


mkdir -p ~/bin ; nano --nowrap ~/bin/fd-update.sh # or use any other editor
# Paste the content of the script above
chmod u+x ~/bin/fd-update.sh

To publish an update:


This will:

  • ask you some question and let you edit AndroidManifest.xml
  • Generate release notes from your commits and let you edit them (in nano, press Ctrl+K to delete a whole line)
  • Publish the new version with the release notes

If it doesn’t work, tell me.

Any questions, opinions, ideas, requests?