fix(release): install the pinned Gradle rather than running the wrapper - #185
Merged
Merged
Conversation
gradle-wrapper.jar is gitignored in this repo, so a fresh checkout has the gradlew script with no engine behind it: "Unable to access jarfile gradle/wrapper/gradle-wrapper.jar". Read the version the wrapper pins (9.7.1 today) out of gradle-wrapper.properties and let setup-gradle provide exactly that, then invoke `gradle` directly. Same version the wrapper would have fetched, with no binary added to the tree and nothing hardcoded to drift when the wrapper is upgraded.
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.
Unable to access jarfile gradle/wrapper/gradle-wrapper.jar..gitignoreexcludes/gradle/wrapper/gradle-wrapper.jar, so a fresh checkout gets thegradlewscript with no engine behind it. This has never surfaced because every existing environment already had the jar on disk from a local Gradle run.The fix reads the version the wrapper pins out of
gradle-wrapper.properties(9.7.1 today) and hassetup-gradleprovide exactly that, then callsgradledirectly. Same Gradle the wrapper would have downloaded, read from the same file — so when you upgrade the wrapper, CI moves with it and there's no hardcoded version to drift.The
chmod +x gradlewfrom the previous PR is gone with it; nothing runs the script now.The alternative, if you'd rather
Gradle's own guidance is to commit
gradle-wrapper.jar— it's what makes./gradlewwork on a machine with no Gradle installed, which is the entire point of the wrapper. Your.gitignoreopts out, presumably to keep a binary out of a public repo. That's a defensible call, but worth knowing it's a deviation, and it means anyone cloning this repo fresh can't build until they run Gradle some other way first.If you'd rather commit it,
git add -f gradle/wrapper/gradle-wrapper.jar, drop the ignore line, and this workflow can go back to./gradlew— I can't upload a binary through the API, so that one's yours.State of the dry run
Cleared so far: checkout,
compileSdk 37install, JDK 17, and the keystore opening with your alias. Still unproven: R8, the baseline profile, andjarsigner.🤖 Generated with Claude Code
https://claude.ai/code/session_01Miqsf1M14nY5TKiZHzyjNY
Note
Low Risk
CI-only release workflow change; build still uses the same pinned Gradle version and the same
bundleReleasegate.Overview
Fixes release CI failing on fresh checkouts with Unable to access jarfile gradle/wrapper/gradle-wrapper.jar because
gradle-wrapper.jaris gitignored and never present on the runner.The workflow now parses the pinned version from
gradle-wrapper.properties, passes it togradle/actions/setup-gradle@v4, and runsgradle :app:bundleReleaseinstead of./gradlew(and drops thechmod +x gradlewworkaround).Header comments for
RELEASE_TOKENare clarified to describe any credential that can bypass the branch ruleset (fine-grained PAT or GitHub App token), not only a PAT with specific scopes.Reviewed by Cursor Bugbot for commit bfff849. Bugbot is set up for automated code reviews on this repo. Configure here.