Automatic deploy 28994149

This commit is contained in:
Renan LE CARO 2025-02-15 20:49:00 +01:00
parent fd9ac99e5b
commit 4468c029db
4 changed files with 12 additions and 13 deletions

View file

@ -1,19 +1,18 @@
#!/bin/bash
# Invalidate web cache
# Generate a random number between 1000 and 9999
random_number=$(shuf -i 1000-9999 -n 1)
# Use sed to replace the pattern with the random number
sed -i "s/\?v=[0-9]*/\?v=$random_number/g" ./app/src/main/assets/index.html
# Replace the version code and name in gradle for fdroid and play store
versionCode=$(($(date +%s) / 60))
versionName=$(date +"%Y-%m-%d %H:%M:%S")
sed -i '' -e "s/^[[:space:]]*versionCode = .*/ versionCode = $versionCode/" \
-e "s/^[[:space:]]*versionName = .*/ versionName = \"$versionName\"/" \
-e "s/^[[:space:]]*versionName = .*/ versionName = \"$versionCode\"/" \
./app/build.gradle.kts
# Invalidate web cache
sed -i "s/\?v=[0-9]*/\?v=$versionCode/g" ./app/src/main/assets/index.html
git add .
git commit -m "Automatic deploy $versionCode"
git tag -f $versionCode