Skip to content

docs: align README with current Child Timer and automate APK releases - #1

Merged
aciderix merged 12 commits into
mainfrom
docs/readme-release-automation
Oct 27, 2026
Merged

aciderix merged 12 commits into
mainfrom
docs/readme-release-automation

Conversation

@aciderix

@aciderix aciderix commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Résumé

  • Remplace le README historique par une documentation fidèle à l'écran actuellement lancé : cadran sans chiffres, 12 animaux, durées de 5 à 60 minutes, fonctionnement plein écran et commandes réelles.
  • Prépare l'emplacement de la capture d'écran : docs/screenshots/main-screen.png.
  • Ajoute un workflow Android pour compiler les variantes debug/release et exécuter les tests unitaires.
  • Ajoute un workflow de publication déclenché par un tag v*, qui construit, signe et joint l'APK à une GitHub Release.
  • Retire la configuration debug qui référençait un debug.keystore absent du dépôt ; Gradle utilisera sa signature debug standard.
  • Ignore les fichiers APK générés et les clés privées locales.

À faire avant une première release

  1. Ajouter la capture d'écran paysage à docs/screenshots/main-screen.png (le README la référence déjà).
  2. Configurer les secrets GitHub ANDROID_KEYSTORE_BASE64, ANDROID_KEY_ALIAS, ANDROID_KEYSTORE_PASSWORD et ANDROID_KEY_PASSWORD.
  3. Confirmer l'applicationId actuel avant la première publication.

Le workflow de release ne publiera rien tant qu'un tag n'est pas poussé et que les secrets de signature ne sont pas renseignés. Le build n'a pas été exécuté localement depuis cet environnement ; le workflow de validation du PR doit le vérifier.

Summary by Sourcery

Align the project documentation with the current Child Timer application and establish automated Android build and signed APK release workflows.

New Features:

  • Document the current Child Timer experience, including its animal-based durations, controls, fullscreen landscape interface, and usage boundaries.
  • Add automated Android build validation for debug and release APK compilation plus unit tests.
  • Add tag-triggered release automation that signs, verifies, and publishes release APKs to GitHub Releases.

Bug Fixes:

  • Remove the debug signing configuration that depended on a missing repository keystore.

Enhancements:

  • Add a referenced landscape main-screen screenshot and guidance for supplying it.
  • Exclude generated APKs and local private signing keys from version control.

CI:

  • Configure GitHub Actions workflows for Android validation and tag-based APK publishing.

Deployment:

  • Document and automate signed APK publication using GitHub Actions secrets.

Documentation:

  • Replace outdated README content with documentation matching the currently implemented application.

@sourcery-ai

sourcery-ai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Le PR réaligne le README sur l’écran actuel du Child Timer, ajoute l’emplacement de sa capture, met en place une validation Android automatisée et fournit une chaîne de release par tag pour construire, signer et publier l’APK, tout en supprimant la configuration debug dépendante d’un keystore local.

Sequence diagram for automated Android validation build

sequenceDiagram
    participant GitHub as GitHub Actions
    participant Build as Android build workflow
    participant Gradle
    participant APK as APK outputs

    GitHub->>Build: push, pull_request, or workflow_dispatch
    Build->>Gradle: testDebugUnitTest
    Build->>Gradle: assembleDebug
    Build->>Gradle: assembleRelease
    Gradle-->>APK: debug and release APKs
    Gradle-->>Build: unit test and build results
Loading

Sequence diagram for tagged signed APK release

sequenceDiagram
    participant GitHub as GitHub Actions
    participant Release as Release workflow
    participant Gradle
    participant Signer as apksigner
    participant GitHubRelease as GitHub Release

    GitHub->>Release: push tag v*
    Release->>Release: validate signing secrets
    Release->>Release: decode keystore
    Release->>Gradle: assembleRelease
    Gradle-->>Release: unsigned release APK
    Release->>Signer: sign APK
    Signer-->>Release: signed APK
    Release->>Signer: verify APK
    Release->>GitHubRelease: gh release create with APK
Loading

File-Level Changes

Change Details Files
Met à jour la documentation pour refléter fidèlement l’interface et le comportement actuels du minuteur.
  • Remplace la description historique par les fonctionnalités réellement disponibles, les 12 animaux et les durées de 5 à 60 minutes.
  • Documente l’utilisation, les gestes cachés, la compatibilité, la construction locale et les limites actuelles.
  • Ajoute une référence à la capture d’écran paysage et un emplacement dédié pour celle-ci.
README.md
docs/screenshots/README.md
Automatise la validation continue des builds Android.
  • Déclenche le workflow sur les pushes vers main, les pull requests et manuellement.
  • Configure JDK 17, le SDK Android API 36 et les build tools 36.0.0.
  • Exécute les tests unitaires et assemble les variantes debug et release.
.github/workflows/android-build.yml
Automatise la génération et la publication d’APK release signés à partir de tags.
  • Déclenche la publication pour les tags v*.
  • Valide les secrets de signature, décode le keystore dans un fichier temporaire et construit l’APK release.
  • Signe et vérifie l’APK avec apksigner, puis crée une GitHub Release avec génération automatique des notes.
.github/workflows/release-apk.yml
Supprime la dépendance à un keystore debug local absent et exclut les artefacts sensibles ou générés.
  • Restaure la signature debug standard de Gradle en retirant la configuration vers debug.keystore.
  • Ignore les APK générés et les clés privées locales.
  • Simplifie les commentaires des dépendances de test et de tooling.
app/build.gradle.kts
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 55d00554-167d-42e9-801e-be43e4ad9b13
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 6 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/release-apk.yml" line_range="9" />
<code_context>
+      - "v*"
+
+permissions:
+  contents: write
+
+jobs:
</code_context>
<issue_to_address>
**Build code can access release credentials**

When a tagged revision or Gradle dependency executes malicious build logic, the checkout action persists its credential, so Gradle build code can read the workflow's `contents: write` token from Git configuration and modify the repository or releases.

Set `persist-credentials: false` for checkout and provide release credentials only to the publishing step.

Also at `.github/workflows/release-apk.yml:17`.
</issue_to_address>

### Comment 2
<location path=".github/workflows/release-apk.yml" line_range="16" />
<code_context>
+    name: Build, sign and publish APK
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check out tagged source
+        uses: actions/checkout@v7
+
</code_context>
<issue_to_address>
**Older build can win the release**

When a tag is force-updated while workflows for its old and new targets overlap, an older run checks out the commit from its tag-push event and can finish first, publishing that APK under the tag after the tag has moved to a newer commit; the newer run then cannot create the same release, so its artifact is not published.

Serialize release jobs by tag and verify the event commit is still the tag's target before publishing.

Also at `.github/workflows/release-apk.yml:80`.
</issue_to_address>

### Comment 3
<location path=".github/workflows/release-apk.yml" line_range="80" />
<code_context>
+        env:
+          GH_TOKEN: ${{ github.token }}
+        run: |
+          gh release create "$GITHUB_REF_NAME" "$SIGNED_APK" \
+            --title "Child Timer $GITHUB_REF_NAME" \
+            --generate-notes \
</code_context>
<issue_to_address>
**Failed upload leaves release incomplete**

When gitHub creates the release but uploading the APK fails, `gh release create` leaves the release record behind, and a retry exits when it encounters that existing release instead of attaching the APK, so users are left without a downloadable APK.

Make publishing idempotent by uploading or replacing the APK asset when the release already exists.
</issue_to_address>

### Comment 4
<location path=".github/workflows/release-apk.yml" line_range="50" />
<code_context>
+      - name: Build release variant
+        run: |
+          chmod +x gradlew
+          ./gradlew --no-daemon assembleRelease
+
+      - name: Sign and verify APK
</code_context>
<issue_to_address>
**Untested APK is published**

When a tag points to a commit whose unit tests have failed or have not passed, the release job runs `assembleRelease` without running `testDebugUnitTest` or waiting for the unit-test workflow, so it signs and publishes an unvalidated APK.

Require the unit-test workflow to pass before the release job signs and publishes the APK.
</issue_to_address>

### Comment 5
<location path=".github/workflows/android-build.yml" line_range="6" />
<code_context>
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+  workflow_dispatch:
</code_context>
<issue_to_address>
**Feature branch pushes skip CI**

When a developer pushes to a non-main branch before opening a pull request, the `push` trigger matches only `main`, so pushes to other branches without a pull request event do not compile or test the change, despite the description promising validation on pushes.

Remove the branch restriction or configure the intended feature-branch push patterns.
</issue_to_address>

### Comment 6
<location path="README.md" line_range="14" />
<code_context>
+</div>
+
+<p align="center">
+  <img src="docs/screenshots/main-screen.png" alt="Child Timer en mode paysage : cadran circulaire et animaux pour choisir une durée" width="900">
+</p>
+
</code_context>
<issue_to_address>
**README screenshot is missing**

When the README is rendered before `docs/screenshots/main-screen.png` is added, the README references a screenshot file that the PR does not add, so readers see a broken image instead of the app preview.

Add the screenshot at the referenced path or remove the image reference until the file is present.

Also at `README.md:15`.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 5 findings to address first, and a bad or compromised v* tag can run release automation with access to the signing key and permission to publish an APK signed as the app. Reverting the workflow cannot retract a published APK or restore a signing key if it was exposed.

Blocking findings: .github/workflows/release-apk.yml:9, .github/workflows/release-apk.yml:16, .github/workflows/release-apk.yml:80, .github/workflows/release-apk.yml:50, .github/workflows/android-build.yml:6


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

- "v*"

permissions:
contents: write

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High · Build code can access release credentials

When a tagged revision or Gradle dependency executes malicious build logic, the checkout action persists its credential, so Gradle build code can read the workflow's contents: write token from Git configuration and modify the repository or releases.

Set persist-credentials: false for checkout and provide release credentials only to the publishing step.

Also at .github/workflows/release-apk.yml:17.

Prompt for AI agents
In `.github/workflows/release-apk.yml` at line 9:

**Build code can access release credentials**

When a tagged revision or Gradle dependency executes malicious build logic, the checkout action persists its credential, so Gradle build code can read the workflow's `contents: write` token from Git configuration and modify the repository or releases.

Set `persist-credentials: false` for checkout and provide release credentials only to the publishing step.

Also at `.github/workflows/release-apk.yml:17`.

name: Build, sign and publish APK
runs-on: ubuntu-latest
steps:
- name: Check out tagged source

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Older build can win the release

When a tag is force-updated while workflows for its old and new targets overlap, an older run checks out the commit from its tag-push event and can finish first, publishing that APK under the tag after the tag has moved to a newer commit; the newer run then cannot create the same release, so its artifact is not published.

Serialize release jobs by tag and verify the event commit is still the tag's target before publishing.

Also at .github/workflows/release-apk.yml:80.

Prompt for AI agents
In `.github/workflows/release-apk.yml` at line 16:

**Older build can win the release**

When a tag is force-updated while workflows for its old and new targets overlap, an older run checks out the commit from its tag-push event and can finish first, publishing that APK under the tag after the tag has moved to a newer commit; the newer run then cannot create the same release, so its artifact is not published.

Serialize release jobs by tag and verify the event commit is still the tag's target before publishing.

Also at `.github/workflows/release-apk.yml:80`.

env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" "$SIGNED_APK" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Failed upload leaves release incomplete

When gitHub creates the release but uploading the APK fails, gh release create leaves the release record behind, and a retry exits when it encounters that existing release instead of attaching the APK, so users are left without a downloadable APK.

Make publishing idempotent by uploading or replacing the APK asset when the release already exists.

Prompt for AI agents
In `.github/workflows/release-apk.yml` at line 80:

**Failed upload leaves release incomplete**

When gitHub creates the release but uploading the APK fails, `gh release create` leaves the release record behind, and a retry exits when it encounters that existing release instead of attaching the APK, so users are left without a downloadable APK.

Make publishing idempotent by uploading or replacing the APK asset when the release already exists.

- name: Build release variant
run: |
chmod +x gradlew
./gradlew --no-daemon assembleRelease

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Untested APK is published

When a tag points to a commit whose unit tests have failed or have not passed, the release job runs assembleRelease without running testDebugUnitTest or waiting for the unit-test workflow, so it signs and publishes an unvalidated APK.

Require the unit-test workflow to pass before the release job signs and publishes the APK.

Prompt for AI agents
In `.github/workflows/release-apk.yml` at line 50:

**Untested APK is published**

When a tag points to a commit whose unit tests have failed or have not passed, the release job runs `assembleRelease` without running `testDebugUnitTest` or waiting for the unit-test workflow, so it signs and publishes an unvalidated APK.

Require the unit-test workflow to pass before the release job signs and publishes the APK.

on:
push:
branches:
- main

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Feature branch pushes skip CI

When a developer pushes to a non-main branch before opening a pull request, the push trigger matches only main, so pushes to other branches without a pull request event do not compile or test the change, despite the description promising validation on pushes.

Remove the branch restriction or configure the intended feature-branch push patterns.

Prompt for AI agents
In `.github/workflows/android-build.yml` at line 6:

**Feature branch pushes skip CI**

When a developer pushes to a non-main branch before opening a pull request, the `push` trigger matches only `main`, so pushes to other branches without a pull request event do not compile or test the change, despite the description promising validation on pushes.

Remove the branch restriction or configure the intended feature-branch push patterns.

Comment thread README.md Resolved
@aciderix
aciderix merged commit 8637bb5 into main Oct 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant