mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-24 14:06:16 -04:00
30 lines
No EOL
939 B
Bash
Executable file
30 lines
No EOL
939 B
Bash
Executable file
#!/bin/bash
|
|
|
|
|
|
# Replace the version code and name in gradle for fdroid and play store
|
|
versionCode=$(($(date +%s) / 60))
|
|
sed -i '' -e "s/^[[:space:]]*versionCode = .*/ versionCode = $versionCode/" \
|
|
-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
|
|
git push
|
|
|
|
|
|
DOMAIN="breakout.lecaro.me"
|
|
PUBLIC_CONTENT="./app/src/main/assets/"
|
|
ssh staging "mkdir -p /opt/mup-nginx-proxy/config/html/static_sites/$DOMAIN"
|
|
rsync -avz --delete --delete-excluded --exclude="*.sh" --exclude="node_modules" --exclude="android" --exclude=".*" $PUBLIC_CONTENT staging:/opt/mup-nginx-proxy/config/html/static_sites/$DOMAIN
|
|
|
|
|
|
# generate zip for itch
|
|
rm -f breakout.zip
|
|
zip -j breakout.zip app/src/main/assets/* |