From 29bd413de302e91ad459aa9a861980a2a01fbb63 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 6 Sep 2026 22:03:14 +0200 Subject: [PATCH] fix(mobile): corrige les liens vers /releases/latest/download Verifie en conditions reelles apres le premier vrai succes de bout en bout de release.yml (v0.2.0, Release Forgejo #12 avec batchcooking.apk attache) : Forgejo, contrairement a GitHub, n'implemente pas le raccourci /releases/latest/download/. Seul /releases/latest lui-meme resout (redirige vers la page de la release) : /releases/latest/download/batchcooking.apk -> 404 /releases/latest -> 303 vers /releases/tag/v0.2.0 (OK) /releases/download/v0.2.0/batchcooking.apk -> 200 (OK, mais pas "latest") Corrige les deux endroits qui presumaient le raccourci GitHub (issue #65 et #66, deja mergees) pour pointer vers /releases/latest tout court : un clic de plus via la page de release Forgejo pour atteindre le fichier, mais un lien qui resout toujours plutot qu'un raccourci qui 404 en permanence. Met a jour le test Cypress de la page d'accueil et le commentaire de release.yml en consequence. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/release.yml | 10 ++++++---- apps/web/cypress/e2e/landing.ts | 14 +++++++------- apps/web/src/features/app-update/UpdateBanner.tsx | 15 +++++++++------ apps/web/src/pages/landing/LandingPage.tsx | 15 ++++++++++----- 4 files changed, 32 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96ac662..fe3537a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -104,10 +104,12 @@ jobs: chmod +x ./gradlew ./gradlew assembleRelease -PandroidVersionName="$ANDROID_VERSION_NAME" -PandroidVersionCode="$ANDROID_VERSION_CODE" - # Nom de fichier stable, jamais versionné : c'est ce qui permet à la - # page d'accueil (#65) de pointer en permanence vers - # /releases/latest/download/batchcooking.apk sans jamais changer de - # lien d'une release à l'autre. + # Nom de fichier stable, jamais versionné : la page d'accueil (#65) + # pointe vers /releases/latest (Forgejo n'a pas l'équivalent du + # raccourci GitHub /releases/latest/download/, seul + # /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 run: cp apps/web/android/app/build/outputs/apk/release/app-release.apk batchcooking.apk diff --git a/apps/web/cypress/e2e/landing.ts b/apps/web/cypress/e2e/landing.ts index 6763477..4067516 100644 --- a/apps/web/cypress/e2e/landing.ts +++ b/apps/web/cypress/e2e/landing.ts @@ -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 -// filename (issue #64 builds/attaches it). We only assert the link is there -// and points at the right URL — the file itself is external to the suite. +// filename (issue #64 builds/attaches it). Points at the release page +// itself, not a direct file URL: Forgejo has no GitHub-style +// `/releases/latest/download/` 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", () => { cy.get(".landing__hero .landing__mobile-link") .should("be.visible") - .and( - "have.attr", - "href", - "https://git.dev.kyuno.fr/kyuno/batchCooking/releases/latest/download/batchcooking.apk", - ); + .and("have.attr", "href", "https://git.dev.kyuno.fr/kyuno/batchCooking/releases/latest"); }); diff --git a/apps/web/src/features/app-update/UpdateBanner.tsx b/apps/web/src/features/app-update/UpdateBanner.tsx index 7b02f10..966de16 100644 --- a/apps/web/src/features/app-update/UpdateBanner.tsx +++ b/apps/web/src/features/app-update/UpdateBanner.tsx @@ -10,11 +10,14 @@ import { useAppUpdateCheck } from "./useAppUpdateCheck"; * ``: a version check is informative, never something that should * block the rest of the page. * - * "Mettre à jour" opens the download link externally (the system browser - * handles the download + Android's own install prompt) rather than an - * in-app `PackageInstaller` flow — no `REQUEST_INSTALL_PACKAGES` permission, - * no extra native code, for a marginal UX gain (see issue #66's own - * hors-scope). + * "Mettre à jour" opens the Forgejo release page externally (not a direct + * file link — Forgejo has no GitHub-style `/releases/latest/download/` + * shortcut, only `/releases/latest` itself resolves; verified live against + * the first real release) rather than an in-app `PackageInstaller` flow — + * 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() { const { t } = useTranslation(); @@ -30,7 +33,7 @@ export function UpdateBanner() {
diff --git a/apps/web/src/pages/landing/LandingPage.tsx b/apps/web/src/pages/landing/LandingPage.tsx index ed3e33f..689dcd0 100644 --- a/apps/web/src/pages/landing/LandingPage.tsx +++ b/apps/web/src/pages/landing/LandingPage.tsx @@ -53,14 +53,19 @@ export function LandingPage() { {/* * Secondary action — an account is needed on any platform, so the * Android build is a discreet link under the CTA row, not a third - * button. Points at the Forgejo "latest release" asset with a - * stable filename (see issue #64); 404s until that pipeline ships, - * accepted as a transient state. The hint is honest that this is a - * sideloaded .apk, not a Play Store listing. + * button. Points at the Forgejo "latest release" page (NOT a + * direct-download URL): Forgejo, unlike GitHub, has no + * `/releases/latest/download/` compound route — only + * `/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. */} {t("landing.hero.mobileDownload")} -- 2.45.2