This commit is contained in:
Renan LE CARO 2025-02-15 20:44:39 +01:00
parent a38e8f418e
commit 907f078304
4 changed files with 14 additions and 16 deletions

View file

@ -15,17 +15,8 @@ android {
applicationId = "me.lecaro.breakout" applicationId = "me.lecaro.breakout"
minSdk = 21 minSdk = 21
targetSdk = 34 targetSdk = 34
// versionCode = 7 versionCode = 28993740
// versionName = "7.0" versionName = "2025-02-15 14:00:57"
// Get the current Unix timestamp in seconds
versionCode = (System.currentTimeMillis() / 1000/60).toInt()
// Get the current date as a string
versionName = ZonedDateTime.now(ZoneId.of("CET"))
.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { vectorDrawables {
useSupportLibrary = true useSupportLibrary = true

View file

@ -8,14 +8,14 @@
/> />
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Breakout 𝟕𝟏</title> <title>Breakout 𝟕𝟏</title>
<link rel="stylesheet" href="style.css?v=5388" /> <link rel="stylesheet" href="style.css?v=4242" />
<link rel="icon" href="./icon.svg" /> <link rel="icon" href="./icon.svg" />
</head> </head>
<body> <body>
<button id="menu"><span> menu</span></button> <button id="menu"><span> menu</span></button>
<button id="score"></button> <button id="score"></button>
<canvas id="game"></canvas> <canvas id="game"></canvas>
<script src="levels.js?v=5388"></script> <script src="levels.js?v=4242"></script>
<script src="game.js?v=5388"></script> <script src="game.js?v=4242"></script>
</body> </body>
</html> </html>

BIN
breakout.zip Normal file

Binary file not shown.

View file

@ -1,13 +1,20 @@
#!/bin/bash #!/bin/bash
#Randomly shuffle the version ids # Invalidate web cache
# Generate a random number between 1000 and 9999 # Generate a random number between 1000 and 9999
random_number=$(shuf -i 1000-9999 -n 1) random_number=$(shuf -i 1000-9999 -n 1)
# Use sed to replace the pattern with the random number # 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 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\"/" \
./app/build.gradle.kts
DOMAIN="breakout.lecaro.me" DOMAIN="breakout.lecaro.me"
PUBLIC_CONTENT="./app/src/main/assets/" PUBLIC_CONTENT="./app/src/main/assets/"
ssh staging "mkdir -p /opt/mup-nginx-proxy/config/html/static_sites/$DOMAIN" ssh staging "mkdir -p /opt/mup-nginx-proxy/config/html/static_sites/$DOMAIN"