fix(mobile): corrige les liens vers /releases/latest/download #76

Merged
kyuno merged 1 commit from fix/forgejo-latest-release-url into main 2026-09-06 22:21:39 +02:00
4 changed files with 32 additions and 22 deletions
Showing only changes of commit 29bd413de3 - Show all commits

View file

@ -104,10 +104,12 @@ jobs:
chmod +x ./gradlew chmod +x ./gradlew
./gradlew assembleRelease -PandroidVersionName="$ANDROID_VERSION_NAME" -PandroidVersionCode="$ANDROID_VERSION_CODE" ./gradlew assembleRelease -PandroidVersionName="$ANDROID_VERSION_NAME" -PandroidVersionCode="$ANDROID_VERSION_CODE"
# Nom de fichier stable, jamais versionné : c'est ce qui permet à la # Nom de fichier stable, jamais versionné : la page d'accueil (#65)
# page d'accueil (#65) de pointer en permanence vers # pointe vers /releases/latest (Forgejo n'a pas l'équivalent du
# /releases/latest/download/batchcooking.apk sans jamais changer de # raccourci GitHub /releases/latest/download/<fichier>, seul
# lien d'une release à l'autre. # /releases/latest lui-même résout) — un nom stable évite au moins que
# l'utilisateur voie un nom de fichier différent à chaque release une
# fois sur la page.
- name: Renomme l'APK sous un nom stable - name: Renomme l'APK sous un nom stable
run: cp apps/web/android/app/build/outputs/apk/release/app-release.apk batchcooking.apk run: cp apps/web/android/app/build/outputs/apk/release/app-release.apk batchcooking.apk

View file

@ -16,14 +16,14 @@ Then("I should see the landing call to action", () => {
}); });
// The Android build is distributed as a Forgejo release asset with a stable // The Android build is distributed as a Forgejo release asset with a stable
// filename (issue #64 builds/attaches it). We only assert the link is there // filename (issue #64 builds/attaches it). Points at the release page
// and points at the right URL — the file itself is external to the suite. // itself, not a direct file URL: Forgejo has no GitHub-style
// `/releases/latest/download/<file>` shortcut, only `/releases/latest`
// resolves (verified live against the first real release). We only assert
// the link is there and points at the right URL — the file itself is
// external to the suite.
Then("I should see the Android download link", () => { Then("I should see the Android download link", () => {
cy.get(".landing__hero .landing__mobile-link") cy.get(".landing__hero .landing__mobile-link")
.should("be.visible") .should("be.visible")
.and( .and("have.attr", "href", "https://git.dev.kyuno.fr/kyuno/batchCooking/releases/latest");
"have.attr",
"href",
"https://git.dev.kyuno.fr/kyuno/batchCooking/releases/latest/download/batchcooking.apk",
);
}); });

View file

@ -10,11 +10,14 @@ import { useAppUpdateCheck } from "./useAppUpdateCheck";
* `<dialog>`: a version check is informative, never something that should * `<dialog>`: a version check is informative, never something that should
* block the rest of the page. * block the rest of the page.
* *
* "Mettre à jour" opens the download link externally (the system browser * "Mettre à jour" opens the Forgejo release page externally (not a direct
* handles the download + Android's own install prompt) rather than an * file link — Forgejo has no GitHub-style `/releases/latest/download/<file>`
* in-app `PackageInstaller` flow — no `REQUEST_INSTALL_PACKAGES` permission, * shortcut, only `/releases/latest` itself resolves; verified live against
* no extra native code, for a marginal UX gain (see issue #66's own * the first real release) rather than an in-app `PackageInstaller` flow —
* hors-scope). * no `REQUEST_INSTALL_PACKAGES` permission, no extra native code, for a
* marginal UX gain (see issue #66's own hors-scope). One extra tap on the
* release page to reach the actual asset, then the system browser handles
* the download + Android's own install prompt as before.
*/ */
export function UpdateBanner() { export function UpdateBanner() {
const { t } = useTranslation(); const { t } = useTranslation();
@ -30,7 +33,7 @@ export function UpdateBanner() {
<div className="update-banner__actions"> <div className="update-banner__actions">
<a <a
className="update-banner__update" className="update-banner__update"
href="https://git.dev.kyuno.fr/kyuno/batchCooking/releases/latest/download/batchcooking.apk" href="https://git.dev.kyuno.fr/kyuno/batchCooking/releases/latest"
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
> >

View file

@ -53,14 +53,19 @@ export function LandingPage() {
{/* {/*
* Secondary action — an account is needed on any platform, so the * Secondary action — an account is needed on any platform, so the
* Android build is a discreet link under the CTA row, not a third * Android build is a discreet link under the CTA row, not a third
* button. Points at the Forgejo "latest release" asset with a * button. Points at the Forgejo "latest release" page (NOT a
* stable filename (see issue #64); 404s until that pipeline ships, * direct-download URL): Forgejo, unlike GitHub, has no
* accepted as a transient state. The hint is honest that this is a * `/releases/latest/download/<file>` compound route — only
* sideloaded .apk, not a Play Store listing. * `/releases/latest` itself resolves (redirects to the release's
* own page), verified live against the first real v0.2.0 release.
* One extra click via Forgejo's own release page to reach the
* actual `batchcooking.apk` asset, but a link that will always
* resolve rather than a shortcut that 404s. The hint is honest
* that this is a sideloaded .apk, not a Play Store listing.
*/} */}
<a <a
className="landing__mobile-link" className="landing__mobile-link"
href="https://git.dev.kyuno.fr/kyuno/batchCooking/releases/latest/download/batchcooking.apk" href="https://git.dev.kyuno.fr/kyuno/batchCooking/releases/latest"
> >
<Smartphone aria-hidden /> <Smartphone aria-hidden />
{t("landing.hero.mobileDownload")} {t("landing.hero.mobileDownload")}