Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/release-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,16 @@ jobs:
SHA256: ${{ steps.apk.outputs.sha256 }}
CERT: ${{ steps.apk.outputs.cert }}
BYTES: ${{ steps.apk.outputs.bytes }}
CODE: ${{ github.run_number }}
run: |
set -euo pipefail
notes="$RUNNER_TEMP/notes.md"
{
printf 'Hermit %s: a preview build to try Hermit on your phone and run the Device lab.\n\n' "$VERSION"
printf -- '- **hermit-%s.apk**, %s bytes\n' "$VERSION" "$BYTES"
printf -- "- SHA-256: \`%s\`\n" "$SHA256"
printf -- "- Signing certificate SHA-256: \`%s\`\n\n" "$CERT"
printf -- "- Signing certificate SHA-256: \`%s\`\n" "$CERT"
printf -- "- versionCode: \`%s\`\n\n" "$CODE"
printf 'How to install it, check it and run the Device lab: https://github.com/%s/blob/main/docs/devices.md\n\n' "$GITHUB_REPOSITORY"
printf "The model isn't in the APK. On first run Hermit downloads it once (about 530 MB) and checks it against its pinned SHA-256.\n"
} > "$notes"
Expand Down
17 changes: 16 additions & 1 deletion docs/devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,22 @@ erases Hermit's data, including the downloaded model.

The preview APK is an ordinary release build of `apps/mobile`. Set up as [CONTRIBUTING.md](../CONTRIBUTING.md) says
for the Android app, then build `:app:assembleRelease` instead of `:app:assembleDebug`. A release build carries the
app's code, so it runs without Metro. It signs with the key you name when Gradle runs, in the environment or as Gradle
app's code, so it runs without Metro.

To rebuild a published preview from its tag, give the build the same version the release workflow gave it first.
`versionName` is the tag without the `v`; `versionCode` is the number printed in that release's notes. Run this from
the repository root, on the tag's commit (the values here are examples; use the ones your release's notes print):

```sh
VERSION=0.1.0-preview.1 CODE=412 node -e '
const fs = require("node:fs");
const path = "apps/mobile/app.json";
const app = JSON.parse(fs.readFileSync(path, "utf8"));
app.expo.version = process.env.VERSION;
app.expo.android.versionCode = Number(process.env.CODE);
fs.writeFileSync(path, JSON.stringify(app, null, 2) + "\n");
'
``` It signs with the key you name when Gradle runs, in the environment or as Gradle
properties (for example in `~/.gradle/gradle.properties`), never in a file in the repository:

| Environment | Gradle property |
Expand Down
Loading