feat: allow injecting env secrets into KMP/Gradle release builds#111
Closed
PavelMesicek wants to merge 1 commit into
Closed
feat: allow injecting env secrets into KMP/Gradle release builds#111PavelMesicek wants to merge 1 commit into
PavelMesicek wants to merge 1 commit into
Conversation
Reusable release workflows could only inject secrets via secrets.properties (Secrets Gradle plugin) and .xcconfig. KMP projects that bake secrets into BuildKonfig/BuildConfig via System.getenv(...) — e.g. API gateway keys in a ProductFlavors definition — had no way to feed those secrets into the Gradle `bundle…` task or the KMP `make build` step, so they couldn't migrate their release workflows to the reusable ones. Add an optional, backward-compatible env-passthrough: - android-build-googlePlay action: new `build_env` input, appended to $GITHUB_ENV before the Gradle bundle build. - android-cloud-release-googlePlay workflow: new optional `BUILD_ENV` secret forwarded to the action. - ios-kmp-selfhosted-release workflow: new optional `KMP_BUILD_ENV` secret, exported to $GITHUB_ENV before the KMP framework build. Defaults are empty, so existing consumers are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
Zavírám — na consumer straně jdeme cestou |
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.
Problem
Reusable release workflows can only inject secrets via
secrets.properties(Secrets Gradle plugin → BuildConfig) and.xcconfig. KMP projects that bake secrets intoBuildKonfig/BuildConfigviaSystem.getenv(...)— e.g. API gateway keys in aProductFlavorsdefinition — have no way to feed those secrets into the Gradlebundle…task or the KMPmake buildstep.Concrete case: the Kaktus / Mobil.cz KMP repo reads
System.getenv("KAKTUS_API_GW_KEY")/MOBIL_API_GW_KEYat Gradle configuration time. It therefore can't migrate its hand-rolled release workflows to the reusable ones — doing so would silently ship a prod build with an empty API gateway key.Change
Add an optional, backward-compatible env-passthrough exported to
$GITHUB_ENVbefore the build step (mirrors howsecret_propertiesalready works):android-build-googlePlayaction — newbuild_envinput, appended to$GITHUB_ENVbefore the Gradle bundle build.android-cloud-release-googlePlayworkflow — new optionalBUILD_ENVsecret forwarded to the action.ios-kmp-selfhosted-releaseworkflow — new optionalKMP_BUILD_ENVsecret, exported to$GITHUB_ENVbefore the KMP framework build.All three default to empty, so existing consumers are unaffected.
Usage (consumer side)
Multiple keys: one
KEY=VALUEper line.Notes
$GITHUB_ENVstay masked in logs.2.5.0) since consumers pin to tags.🤖 Generated with Claude Code