feat: improve keystore existence checks in APK build process
Some checks failed
Build Android APK / build (push) Failing after 6m33s
Some checks failed
Build Android APK / build (push) Failing after 6m33s
This commit is contained in:
25
.github/workflows/build-apk.yml
vendored
25
.github/workflows/build-apk.yml
vendored
@@ -34,13 +34,24 @@ jobs:
|
|||||||
- name: Sync Capacitor
|
- name: Sync Capacitor
|
||||||
run: npx cap sync android
|
run: npx cap sync android
|
||||||
|
|
||||||
|
- name: Check if keystore exists
|
||||||
|
id: keystore-check
|
||||||
|
run: |
|
||||||
|
if [ -n "$KEYSTORE_BASE64" ]; then
|
||||||
|
echo "exists=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "exists=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
env:
|
||||||
|
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
|
||||||
|
|
||||||
- name: Decode keystore
|
- name: Decode keystore
|
||||||
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
|
if: steps.keystore-check.outputs.exists == 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/impostor.keystore
|
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/impostor.keystore
|
||||||
|
|
||||||
- name: Create keystore.properties
|
- name: Create keystore.properties
|
||||||
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
|
if: steps.keystore-check.outputs.exists == 'true'
|
||||||
run: |
|
run: |
|
||||||
cat > android/keystore.properties << EOF
|
cat > android/keystore.properties << EOF
|
||||||
storeFile=../impostor.keystore
|
storeFile=../impostor.keystore
|
||||||
@@ -50,17 +61,17 @@ jobs:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Build Release APK
|
- name: Build Release APK
|
||||||
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
|
if: steps.keystore-check.outputs.exists == 'true'
|
||||||
working-directory: android
|
working-directory: android
|
||||||
run: ./gradlew assembleRelease --no-daemon
|
run: ./gradlew assembleRelease --no-daemon
|
||||||
|
|
||||||
- name: Build Debug APK (fallback)
|
- name: Build Debug APK (fallback)
|
||||||
if: ${{ secrets.KEYSTORE_BASE64 == '' }}
|
if: steps.keystore-check.outputs.exists == 'false'
|
||||||
working-directory: android
|
working-directory: android
|
||||||
run: ./gradlew assembleDebug --no-daemon
|
run: ./gradlew assembleDebug --no-daemon
|
||||||
|
|
||||||
- name: Upload Release APK
|
- name: Upload Release APK
|
||||||
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
|
if: steps.keystore-check.outputs.exists == 'true'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: impostor-game-release
|
name: impostor-game-release
|
||||||
@@ -68,9 +79,9 @@ jobs:
|
|||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- name: Upload Debug APK (fallback)
|
- name: Upload Debug APK (fallback)
|
||||||
if: ${{ secrets.KEYSTORE_BASE64 == '' }}
|
if: steps.keystore-check.outputs.exists == 'false'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: impostor-game-debug
|
name: impostor-game-debug
|
||||||
path: android/app/build/outputs/apk/debug/app-debug.apk
|
path: android/app/build/outputs/apk/debug/app-debug.apk
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
Reference in New Issue
Block a user