From fcf4d02caf9dc08facb9c18ceff5056827fe494c Mon Sep 17 00:00:00 2001 From: Oqba Date: Wed, 28 Oct 2026 07:16:54 +0330 Subject: [PATCH] =?UTF-8?q?=D8=AE=D9=88=D8=AF=DA=A9=D8=A7=D8=B1=D8=B3?= =?UTF-8?q?=D8=A7=D8=B2=DB=8C=20=D8=A2=D9=BE=D8=AF=DB=8C=D8=AA=20update.js?= =?UTF-8?q?on=20=D9=BE=D8=B3=20=D8=A7=D8=B2=20=D8=A7=D9=86=D8=AA=D8=B4?= =?UTF-8?q?=D8=A7=D8=B1=20=D9=85=D9=88=D9=81=D9=82=20APK=20=D8=AF=D8=B1=20?= =?UTF-8?q?=DA=AF=DB=8C=D8=AA=E2=80=8C=D9=87=D8=A7=D8=A8=20=D8=A7=DA=A9?= =?UTF-8?q?=D8=B4=D9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f314867..042f260 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,3 +46,30 @@ jobs: files: app/build/outputs/apk/release/MonthlyPaymentApp-${{ github.ref_name }}.apk env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update update.json after release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG_NAME="${{ github.ref_name }}" + VERSION_NAME="${TAG_NAME#v}" + VERSION_CODE=$(grep 'versionCode' app/build.gradle.kts | head -n 1 | awk '{print $3}') + + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git fetch origin main + git checkout main + + cat < update.json + { + "versionCode": ${VERSION_CODE}, + "versionName": "${VERSION_NAME}", + "url": "https://github.com/oqba26/MonthlyPaymentApp/releases/download/${TAG_NAME}/MonthlyPaymentApp-${TAG_NAME}.apk", + "releaseNotes": "بهبودهای پایداری و عملکرد همگام‌سازی", + "isForceUpdate": false + } + EOF + + git add update.json + git commit -m "auto-update update.json for release ${TAG_NAME}" || true + git push origin main