Can't Pass ANDROID_KEYSTORE_PASS To Unity Builder Script
See original GitHub issueBug description
No matter what I try, I’m unable to pass ANDROID_KEYSTORE_PASS
to my Unity builder script.
How to reproduce
See the following config & code:
.github/workflows/main.yml
:
- uses: game-ci/unity-builder@v2
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
androidKeystoreName: user.keystore
androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }}
androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }}
androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }}
Assets/Editor/AndroidBuilder.cs
:
public class AndroidBuilder
{
static void ProductionBuild()
{
foreach(DictionaryEntry e in System.Environment.GetEnvironmentVariables())
{
Debug.LogError("Env: " + e.Key + ":" + e.Value);
}
string[] scenes = EditorBuildSettings.scenes.Where(scene => scene.enabled).Select(s => s.path).ToArray();
var buildPlayerOptions = new BuildPlayerOptions
{
scenes = scenes,
target = BuildTarget.Android,
locationPathName = "build/Build.apk",
};
BuildPipeline.BuildPlayer(buildPlayerOptions);
}
}
Output spits out a bunch of environment variables, notably:
Env: UNITY_EMAIL:*** Env: UNITY_PASSWORD:*** Env: UNITY_SERIAL:*** Env: ANDROID_KEYSTORE_BASE64: Env: ANDROID_KEYSTORE_PASS: Env: ANDROID_KEYALIAS_NAME: Env: ANDROID_KEYALIAS_PASS:
(Notice the 4 bottom ones are empty)
The final APK isn’t produced and has the error message:
UnityException: Can not sign the application
Unable to sign the application; please provide passwords!
Expected behavior
ANDROID_KEYSTORE_PASS is populated so an APK can be signed
Additional details
I’ve tried so many things. Notably, manually setting the password in AndroidBuilder.cs
PlayerSettings.keystorePass = "Password123";
Builds the APK no problem, indicating the rest of my code works. Any suggestions?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
@lebek As far as I know GitHub does not have a hierarchy in it’s jobs. What do you mean by parent job. Would you mind editing your post to include the incorrect example as well, so we can see the difference?
Edit: I see, the job is used to call a reusable workflow. In that case you can also
inherit
the secrets (see docs).Even better 😃