Skip to content

ci(release): sign Android helper releases from the protected release environment - #5352

Open
thymikee wants to merge 3 commits into
mainfrom
fix/android-helper-release-signing
Open

thymikee wants to merge 3 commits into
mainfrom
fix/android-helper-release-signing

Conversation

@thymikee

@thymikee thymikee commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Nightly releases run release.yml from main and check out the 0.22 SHA. #5341 removes the committed Android helper signing key on 0.22. After it, scripts/build-android-helper.sh signs with AGENT_DEVICE_ANDROID_KEYSTORE, and with AGENT_DEVICE_ANDROID_HELPER_RELEASE=1 it fails instead of using a throwaway key. This PR gives main's publishing jobs that keystore and marker.

Merge order: this PR first, then #5341. The reverse order lets a nightly publish a throwaway-signed helper.
Required before merge (maintainer): create GitHub environment release with protection rules, and add the environment secrets ANDROID_HELPER_KEYSTORE_BASE64 and ANDROID_HELPER_KEYSTORE_PASSWORD there. Until both exist, nightly and stable runs stop at the signing step.

Before / after

Before: with #5341 merged, a nightly from main would sign with a dev key and publish a helper nobody can update.
After: the release.yml build job runs in release for nightly and stable (none for dry-run), sets the marker, and runs setup-android-helper-signing from the workflow commit (.release-tools), so a 0.22 source without that action still works. release-android-snapshot-helper.yml runs in release and builds only github.ref; its checkout_ref input is removed. The publisher gets no secrets.

Validation

Head 9f46ad6; CI pending.
pnpm exec vitest run --project unit-core test/ci/release-workflow.test.ts test/repo-guards/release-assets.test.ts: 56 passed.
Production delta: about +40 workflow lines, no package code.
Residual risk: main's own helper script keeps its committed key until the 0.22 change reaches main.

…environment

Nightlies run release.yml from main and check out the 0.22 SHA. Once 0.22 drops the
committed helper key (#5341), its build script needs the release keystore, and with
AGENT_DEVICE_ANDROID_HELPER_RELEASE=1 it fails instead of using a throwaway key.
Publishing jobs now run in the release environment, export the keystore, and set the
marker; PR dry runs get neither.
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.77 MB 6.77 MB 0 B
Package (unpacked) 6.77 MB 6.77 MB 0 B
Package (download) 2.07 MB 2.07 MB +5 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 24.6 ms 21.7 ms -2.9 ms
CLI --help 48.2 ms 48.5 ms +0.3 ms

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging 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.

Apex Sentinel: 2 new findings on 8fe60c5. The verdict and the full list are in the summary comment.

@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

The PR is ready at 8fe60c5. CI is green: 34 checks, none failing. There are no conflicts. Merge now needs the maintainer to create the protected release environment with branch rules and the two environment secrets, and to take the PR out of draft.

Not blocking, and fine to take or leave: action.yml:25 writes the password to GITHUB_ENV, so every later step in the job inherits it. Writing only the keystore path there and passing the password as step-level env on the build step would narrow that. Also, the comment at release.yml:296 says VERCEL_SITE_DEPLOY_HOOK is the only secret this workflow reads, but the build job now reads the two keystore secrets.

The open inline thread on the GITHUB_ENV password at #5352 (comment) still applies as hardening only. The thread at #5352 (comment) does not apply, because the PR body states that main's build script ignores the env and the step takes effect once #5341 lands, so it can be resolved.

Not verified here: the 0.22 head of scripts/build-android-helper.sh honoring AGENT_DEVICE_ANDROID_HELPER_RELEASE fail-closed (that is #5341's scope), the release environment settings and branch rules, a local re-run of the vitest files (CI results were used), and that an empty environment expression behaves as no environment.

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of f46b585

Since the review of 8fe60c5: 0 new · 0 still open · 2 no longer raised

No open findings.

Reviewed with this repository's own Sentinel configuration (7c6ef4a2ed46).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Reviewed f46b585, the delta since the earlier review at 8fe60c5 (#5352 (comment)). The code looks correct, and all 32 checks pass at this commit. The unit-core job covers the delta, which touches only workflow YAML, the composite action and test/ci/release-workflow.test.ts.

The keystore password no longer goes to GITHUB_ENV (#5352 (comment), now fixed). It is scoped to the two build steps. The thread about the helper script ignoring the keystore variables on main (#5352 (comment)) does not apply. The PR body states this, and the signing step still fails when the key is missing. Please resolve both threads.

Not verified here: the workflows were not run, and environment release, its secrets and its protection rules are not visible from the review. Environment secrets resolving inside the reusable snapshot workflow rests on GitHub semantics, not on a live run. The consumer script was read at PR #5341 head 4e250d3, not at a merged 0.22, and main still signs with its committed key. The validation lines in the PR body were not re-run locally.

Before merge, the maintainer must create environment release and its two secrets, as the PR body states.

@thymikee
thymikee marked this pull request as ready for review December 3, 2026 13:40

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .github/workflows/release.yml Resolved
Comment thread test/ci/release-workflow.test.ts Resolved

This branch has not been deployed

No deployments
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