This commit is contained in:
nomadics9 2024-12-16 01:39:04 +03:00
parent da993a010d
commit aad2766f57

View file

@ -111,13 +111,23 @@ jobs:
- name: Find APK Files - name: Find APK Files
run: find app-release -name "*.apk" run: find app-release -name "*.apk"
# Step 8: Sign - name: Sign app APK
- name: Decode Keystore - uses: r0adkll/sign-android-release@v1
env: # ID used to access action output
KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }} id: sign_app
run: | with:
echo "$KEYSTORE_FILE" | base64 -d > keystore.jks releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEYSTORE_FILE }}
alias: ${{ secrets.KEYSTORE_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
# # Step 8: Sign
# - name: Decode Keystore
# env:
# KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }}
# run: |
# echo "$KEYSTORE_FILE" | base64 -d > keystore.jks
#
# # Step 9: Sign the APK # # Step 9: Sign the APK
# - name: Sign APK # - name: Sign APK
# env: # env:
@ -138,35 +148,13 @@ jobs:
# jarsigner -verify -verbose -certs \ # jarsigner -verify -verbose -certs \
# app-release/app/build/outputs/apk/release/alaskartv-androidtv-v${{ env.VERSION_NAME }}-release-unsigned.apk # app-release/app/build/outputs/apk/release/alaskartv-androidtv-v${{ env.VERSION_NAME }}-release-unsigned.apk
- name: Sign APK with apksigner
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
run: |
apksigner sign --ks keystore.jks \
--ks-key-alias "$KEYSTORE_ALIAS" \
--ks-pass env:KEYSTORE_PASSWORD \
--key-pass env:KEY_PASSWORD \
--out app-release/app/build/outputs/apk/release/alaskartv-androidtv-v${{ env.VERSION_NAME }}-release.apk \
app-release/app/build/outputs/apk/release/alaskartv-androidtv-v${{ env.VERSION_NAME }}-release-unsigned.apk
- name: Verify APK Signature
run: |
apksigner verify --verbose app-release/app/build/outputs/apk/release/alaskartv-androidtv-v${{ env.VERSION_NAME }}-release.apk
# Step 10: Rename Signed APK
- name: Rename Signed APK
run: |
mv app-release/app/build/outputs/apk/release/alaskartv-androidtv-v${{ env.VERSION_NAME }}-release-unsigned.apk \
app-release/app/build/outputs/apk/release/alaskartv-androidtv-v${{ env.VERSION_NAME }}-release-signed.apk
# Step 11: Upload Signed APK as Artifact # Step 11: Upload Signed APK as Artifact
- name: Upload Signed APK - name: Upload Signed APK
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: signed-apk name: signed-apk
path: app-release/app/build/outputs/apk/release/alaskartv-androidtv-v${{ env.VERSION_NAME }}-release-signed.apk path: ${{steps.sign_app.outputs.signedReleaseFile}}
# path: app-release/app/build/outputs/apk/release/alaskartv-androidtv-v${{ env.VERSION_NAME }}-release-signed.apk