Skip the Hermes build when the archive is already published - #444
Merged
Conversation
The paths filter fires on any edit to hermes.ts, hermes-prebuilt.ts or this workflow, not just a bumped pin — and `--no-download` meant the run then rebuilt for half an hour and re-uploaded 118 MB identical to what was already on the release. Merging #443 did exactly that. The Actions cache does not cover this: it is scoped to the branch that wrote it, so a build on a feature branch leaves nothing behind for `next`, and it evicts after 7 days idle or under the repository's 10 GB cap, which several multi-gigabyte ccache entries already compete for. The archive name covers every input that changes its contents, so an asset already published under that name is what the run would rebuild. Look it up and skip the build and the upload, with a `force` dispatch input for deliberate rebuilds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UkNbgdyuKgHaFwT27RahGH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merging #443 kicked off run 31724154546, which set about rebuilding — for half an hour — the archive that had been published 25 minutes earlier, to then re-upload 118 MB byte-for-byte equivalent to what was already there. I cancelled it.
What did and didn't guard this
The
paths:filter works. The workflow does not fire on every merge tonext— only on edits tohermes.ts,hermes-prebuilt.tsor the workflow itself. But that still means any unrelated edit to those files (a comment, a refactor, a new CLI flag) pays for a full rebuild, and #443 was exactly that.The Actions cache does not cover it, for two reasons worth writing down:
next— and disappeared with the branch.test-ios(3 GB) and other ccache entries already compete for.--no-downloaddeliberately bypassed the one authoritative signal — the published asset itself. That flag exists so a forced rebuild doesn't round-trip the asset it is about to replace, which is still right; it just needed a decision made before it.The change
The archive name already covers every input that changes its contents — pinned commit, React Native version, build type, platforms, host architecture. So an asset published under that name is the archive this run would produce. A new step looks it up with
gh release view --json assetsand, when it is there, skips the cache restore, the build and the upload.workflow_dispatchgains aforceinput for deliberate rebuilds — a corrupted upload, or a toolchain change that alters the output without changing the name.Cost when the asset exists: checkout, install, build, two
--printcalls and one API lookup. About a minute, versus thirty.Known gap, not addressed here
A React Native bump changes the archive name but touches none of the paths in the filter, so no asset gets published for the new version until someone dispatches manually — CI and consumers fall back to building locally, correctly but slowly. Adding
pnpm-lock.yamltopaths:would close it, and with this gate in place the cost is a one-minute no-op run per dependency bump. Left out because it widens the trigger noticeably; say the word and it is a one-line follow-up.Test plan
Look for an already-published archivereportsexists=true, the build and publish steps skip, and the run finishes in about a minuteforce: truestill rebuildsGenerated by Claude Code