Skip to content

Test Keystore

Test Keystore #3

Workflow file for this run

name: Test Keystore
on:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- name: Decode and verify keystore
run: |
echo "Decoding keystore..."
echo '${{ secrets.ANDROID_KEYSTORE_BASE64 }}' | base64 --decode > test.keystore
if [ -f test.keystore ]; then
echo "✓ Keystore file created"
echo "File size: $(wc -c < test.keystore) bytes"
else
echo "✗ Failed to create keystore file"
exit 1
fi
echo "Verifying keystore with keytool..."
keytool -list -keystore test.keystore -storepass '${{ secrets.ANDROID_KEYSTORE_PASSWORD }}'
if [ $? -eq 0 ]; then
echo "✓ Keystore password is valid!"
else
echo "✗ Keystore verification failed"
exit 1
fi
echo "Verifying key alias and key password..."
keytool -list -keystore test.keystore \
-storepass '${{ secrets.ANDROID_KEYSTORE_PASSWORD }}' \
-alias '${{ secrets.ANDROID_KEY_ALIAS }}' \
-keypass '${{ secrets.ANDROID_KEY_PASSWORD }}'
if [ $? -eq 0 ]; then
echo "✓ Key alias and password are valid!"
else
echo "✗ Key alias or key password verification failed"
exit 1
fi
- name: Test actual build setup
run: |
# Place keystore where the build expects it
echo '${{ secrets.ANDROID_KEYSTORE_BASE64 }}' | base64 --decode > android/app/release.keystore
# Create local.properties
cat > android/local.properties << EOF
MYAPP_UPLOAD_STORE_FILE=release.keystore
MYAPP_UPLOAD_STORE_PASSWORD=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
MYAPP_UPLOAD_KEY_ALIAS=${{ secrets.ANDROID_KEY_ALIAS }}
MYAPP_UPLOAD_KEY_PASSWORD=${{ secrets.ANDROID_KEY_PASSWORD }}
EOF
echo "✓ Build configuration created"
echo "Keystore location: android/app/release.keystore"
ls -lh android/app/release.keystore
# Test that gradle can read the signing config
cd android
./gradlew app:signingReport || echo "Signing report failed (expected if dependencies not installed)"
- name: Clean up
if: always()
run: |
rm -f test.keystore
rm -f android/app/release.keystore
rm -f android/local.properties