Stop linking the Android APK through a branch-named raw URL.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pepaskopec-blip 2026-09-18 12:22:11 +02:00
commit aa1d8c4426
4 changed files with 72 additions and 6 deletions

View file

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Stáhnout maturita.C</title>
<style>
body {
font-family: system-ui, sans-serif;
max-width: 28rem;
margin: 3rem auto;
padding: 0 1.2rem;
color: #1a1a1a;
}
a.btn {
display: block;
text-align: center;
background: #1a1a1a;
color: #fff;
padding: 1rem 1.2rem;
border-radius: 999px;
text-decoration: none;
font-weight: 600;
}
p { color: #444; line-height: 1.45; }
code { font-size: 0.95em; }
</style>
</head>
<body>
<h1>maturita.C pro Android</h1>
<p>Klepni na tlačítko. Až se APK stáhne, otevři ho a povol instalaci z neznámých zdrojů.</p>
<p>
<a class="btn" id="dl"
href="https://raw.githubusercontent.com/pepaskopec-blip/maturita.c/refs/heads/builds/maturita-android.apk">
Stáhnout APK
</a>
</p>
<p>
Když odkaz hlásí 404, otevři
<a href="https://github.com/pepaskopec-blip/maturita.c/tree/builds">větev builds</a>
a stáhni <code>maturita-android.apk</code> odtud.
</p>
<script>
(function () {
var repo = "pepaskopec-blip/maturita.c";
fetch("https://api.github.com/repos/" + repo + "/commits/builds")
.then(function (r) { return r.json(); })
.then(function (d) {
if (d && d.sha) {
document.getElementById("dl").href =
"https://raw.githubusercontent.com/" + repo + "/" + d.sha + "/maturita-android.apk";
}
})
.catch(function () {});
})();
</script>
</body>
</html>

Binary file not shown.

View file

@ -1,6 +1,6 @@
#!/bin/sh
# Rebuild the three installer zips that README links to. Browsers download a
# zip; they render .command / .sh / .cmd as a text tab.
# Rebuild the installer zips that README links to. Browsers download a
# zip; they render .command / .sh / .cmd / .html as a text tab.
set -eu
@ -24,3 +24,11 @@ rm -f "$here/maturita-installer-macos.zip"
zip -q -FS maturita-installer-windows.zip maturita-installer-windows.cmd
zip -q -FS maturita-installer-linux.zip maturita-installer-linux.sh
# Browsers download a zip; they render .html as a text tab on GitHub.
# The page looks up the tip of `builds` so Fastly cannot serve a cached 404
# for the branch-named APK URL.
cp maturita-android.html "$tmp/Stahnout maturita.C.html"
rm -f "$here/maturita-installer-android.zip"
(cd "$tmp" && zip -q -FS "$here/maturita-installer-android.zip" \
"Stahnout maturita.C.html")