Skip to content

Commit

Permalink
Update android.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
appvpluss authored Feb 7, 2025
1 parent edad714 commit f68669b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,16 @@ jobs:
- name: Build AAB Release
run: ./gradlew ${{ env.main_project_module }}:bundleRelease

# **🚀 اگر فایل APK Release تولید شده باشد، ادامه می‌دهیم**
# **🚀 انتقال APK Release به مسیر صحیح**
- name: Move APK Release to output directory
run: |
mkdir -p app/build/outputs/apk/release/
mv app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/app-release.apk
# **🚀 بررسی وجود فایل APK Release**
- name: Verify if Release APK exists
run: |
if [ -f app/build/outputs/apk/release/app-release-unsigned.apk ]; then
if [ -f app/build/outputs/apk/release/app-release.apk ]; then
echo "APK Release file found!"
else
echo "APK Release file not found!"
Expand All @@ -78,14 +84,13 @@ jobs:
- name: Sign APK
run: |
mv app/build/outputs/apk/release/app-release-unsigned.apk app-release-unsigned.apk
echo "${{ secrets.SIGNING_KEYSTORE }}" | base64 --decode > keystore.jks
apksigner sign --ks keystore.jks --ks-pass pass:${{ secrets.SIGNING_STORE_PASSWORD }} \
--key-pass pass:${{ secrets.SIGNING_KEY_PASSWORD }} --ks-key-alias ${{ secrets.SIGNING_KEY_ALIAS }} \
--out app-release.apk app-release-unsigned.apk
--out app/build/outputs/apk/release/app-release-signed.apk app/build/outputs/apk/release/app-release.apk
- name: Verify APK Signature
run: apksigner verify app-release.apk
run: apksigner verify app/build/outputs/apk/release/app-release-signed.apk

# **🚀 آپلود خروجی‌ها به عنوان Artifact برای دانلود از GitHub Actions**
- name: Upload APK Debug as Artifact
Expand All @@ -98,15 +103,15 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: APK-Release-${{ env.VERSION }}
path: app/build/outputs/apk/release/*.apk
path: app/build/outputs/apk/release/app-release-signed.apk

- name: Upload AAB as Artifact
uses: actions/upload-artifact@v4
with:
name: AAB-Release-${{ env.VERSION }}
path: app/build/outputs/bundle/release/*.aab

# **🚀 ایجاد نسخه جدید در Release GitHub با متن `Released by GitHub Actions`**
# **🚀 ایجاد نسخه جدید در Release GitHub**
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
Expand All @@ -133,7 +138,7 @@ jobs:
- name: Upload APK Release to Release
uses: softprops/action-gh-release@v1
with:
files: app/build/outputs/apk/release/*.apk
files: app/build/outputs/apk/release/app-release-signed.apk
tag_name: ${{ env.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit f68669b

Please sign in to comment.