ci(android): fail-fast on missing release keystore before SDK setup
Move the keystore guard from after the Decode step (step 9) to right after Resolve build label (step 3). A release tag pushed without ANDROID_KEYSTORE_BASE64 configured now fails in seconds instead of after JDK + Python + Android SDK + NDK install (~3-5 min of wasted runner time). Switched the condition from steps.keystore.outputs.present to env.ANDROID_KEYSTORE_BASE64 since the env var is set at job level and the keystore decode step has not yet run at the new position.
This commit is contained in:
@@ -54,6 +54,17 @@ jobs:
|
|||||||
echo "is_release=$IS_RELEASE" >> "$GITHUB_OUTPUT"
|
echo "is_release=$IS_RELEASE" >> "$GITHUB_OUTPUT"
|
||||||
echo "Build label: $LABEL (release=$IS_RELEASE)"
|
echo "Build label: $LABEL (release=$IS_RELEASE)"
|
||||||
|
|
||||||
|
- name: Guard release tag against missing keystore
|
||||||
|
# Release tags MUST produce a release-signed APK, otherwise existing
|
||||||
|
# installs can't upgrade (signature mismatch). Fail loudly instead
|
||||||
|
# of silently falling back to the debug signing config.
|
||||||
|
# Runs before JDK/Python/SDK/NDK setup so a misconfigured release
|
||||||
|
# tag fails in seconds instead of after several minutes of setup.
|
||||||
|
if: ${{ steps.label.outputs.is_release == 'true' && env.ANDROID_KEYSTORE_BASE64 == '' }}
|
||||||
|
run: |
|
||||||
|
echo "::error::Release tag ${{ gitea.ref_name }} requires ANDROID_KEYSTORE_BASE64 (plus KEYSTORE_PASSWORD, KEY_ALIAS, KEY_PASSWORD) to be configured in Gitea → Settings → Secrets."
|
||||||
|
exit 1
|
||||||
|
|
||||||
- name: Setup JDK ${{ env.JAVA_VERSION }}
|
- name: Setup JDK ${{ env.JAVA_VERSION }}
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
@@ -122,15 +133,6 @@ jobs:
|
|||||||
echo "path=$(pwd)/android/keystore/release.jks" >> "$GITHUB_OUTPUT"
|
echo "path=$(pwd)/android/keystore/release.jks" >> "$GITHUB_OUTPUT"
|
||||||
echo "present=true" >> "$GITHUB_OUTPUT"
|
echo "present=true" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Guard release tag against missing keystore
|
|
||||||
# Release tags MUST produce a release-signed APK, otherwise existing
|
|
||||||
# installs can't upgrade (signature mismatch). Fail loudly instead
|
|
||||||
# of silently falling back to the debug signing config.
|
|
||||||
if: ${{ steps.label.outputs.is_release == 'true' && steps.keystore.outputs.present != 'true' }}
|
|
||||||
run: |
|
|
||||||
echo "::error::Release tag ${{ gitea.ref_name }} requires ANDROID_KEYSTORE_BASE64 (plus KEYSTORE_PASSWORD, KEY_ALIAS, KEY_PASSWORD) to be configured in Gitea → Settings → Secrets."
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
- name: Build APK
|
- name: Build APK
|
||||||
working-directory: android
|
working-directory: android
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user