Update project #386
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| paths-ignore: | |
| - '**.md' | |
| pull_request: | |
| paths-ignore: | |
| - '**.md' | |
| workflow_dispatch: | |
| concurrency: | |
| group: environment-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| job-common: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| SHORT_SHA: ${{ steps.expose_sha.outputs.short_sha }} | |
| steps: | |
| - name: expose short commit sha | |
| id: expose_sha | |
| run: | | |
| SHORT_SHA=${GITHUB_SHA::7} | |
| echo "short_sha=$SHORT_SHA" >> $GITHUB_ENV | |
| echo "SHORT_SHA=$SHORT_SHA" >> $GITHUB_OUTPUT | |
| build-mobile: | |
| if: ${{ vars.MOBILE_BUILD_ENABLED == 'true' }} | |
| needs: job-common | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| env: | |
| KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }} | |
| KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} | |
| KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} | |
| KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} | |
| SHORT_SHA: ${{ needs.job-common.outputs.SHORT_SHA }} | |
| steps: | |
| - name: checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # клонирует репозиторий с историей коммитов | |
| - name: setup jdk 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: cache gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/caches | |
| key: gradle-${{ runner.os }}-${{ hashFiles('/*.gradle*', '/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: cache gradle wrapper | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/wrapper | |
| key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
| - name: make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: decode keystore file | |
| id: decode_keystore_file | |
| uses: timheuer/base64-to-file@v1 | |
| with: | |
| fileName: 'keystore_release.jks' | |
| encodedString: ${{ secrets.KEYSTORE_FILE }} | |
| - name: set decoded file location as environment | |
| run: echo "KEYSTORE_FILE=${{ steps.decode_keystore_file.outputs.filePath }}" >> $GITHUB_ENV | |
| - name: assemble debug artifact | |
| run: ./gradlew mobile:assembleDebug | |
| - name: assemble release artifact | |
| if: false | |
| run: ./gradlew mobile:assembleRelease | |
| - name: bundle release artifact | |
| if: false | |
| run: ./gradlew mobile:bundleRelease | |
| - name: upload artifacts to outputs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mobile-build-${{ github.run_id }} | |
| path: | | |
| mobile/build/outputs/apk/free/debug | |
| mobile/build/outputs/apk/paid/debug | |
| mobile/build/outputs/apk/free/release | |
| mobile/build/outputs/apk/paid/release | |
| mobile/build/outputs/bundle/freeRelease | |
| mobile/build/outputs/bundle/paidRelease | |
| - name: expose version | |
| id: version | |
| run: ./gradlew -q printVersion | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT | |
| - name: expose artifacts | |
| run: | | |
| echo "FREE_DEBUG_APK_PATH=$(find mobile/build/outputs/apk/free/debug -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| echo "PAID_DEBUG_APK_PATH=$(find mobile/build/outputs/apk/paid/debug -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| echo "FREE_RELEASE_APK_PATH=$(find mobile/build/outputs/apk/free/release -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| echo "PAID_RELEASE_APK_PATH=$(find mobile/build/outputs/apk/paid/release -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| echo "FREE_BUNDLE_APK_PATH=$(find mobile/build/outputs/bundle/freeRelease -name '*.aab' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| echo "PAID_BUNDLE_APK_PATH=$(find mobile/build/outputs/bundle/paidRelease -name '*.aab' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| - name: telegram notify free debug | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ *${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})* | |
| *Repo:* [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) | |
| *Branch:* [${{ github.ref_name }}](${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}) | |
| *Commit:* [${{ env.SHORT_SHA }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}) | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.FREE_DEBUG_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="Markdown" | |
| - name: telegram notify paid debug | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ *${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})* | |
| *Repo:* [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) | |
| *Branch:* [${{ github.ref_name }}](${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}) | |
| *Commit:* [${{ env.SHORT_SHA }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}) | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.PAID_DEBUG_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="Markdown" | |
| - name: telegram notify free release | |
| if: false | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ *${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})* | |
| *Repo:* [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) | |
| *Branch:* [${{ github.ref_name }}](${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}) | |
| *Commit:* [${{ env.SHORT_SHA }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}) | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.FREE_RELEASE_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="Markdown" | |
| - name: telegram notify paid release | |
| if: false | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ *${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})* | |
| *Repo:* [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) | |
| *Branch:* [${{ github.ref_name }}](${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}) | |
| *Commit:* [${{ env.SHORT_SHA }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}) | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.PAID_RELEASE_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="Markdown" | |
| - name: telegram notify free bundle | |
| if: false | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ *${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})* | |
| *Repo:* [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) | |
| *Branch:* [${{ github.ref_name }}](${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}) | |
| *Commit:* [${{ env.SHORT_SHA }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}) | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.FREE_BUNDLE_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="Markdown" | |
| - name: telegram notify paid bundle | |
| if: false | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ *${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})* | |
| *Repo:* [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) | |
| *Branch:* [${{ github.ref_name }}](${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}) | |
| *Commit:* [${{ env.SHORT_SHA }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}) | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.PAID_BUNDLE_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="Markdown" | |
| build-wear: | |
| if: ${{ vars.WEAR_BUILD_ENABLED == 'true' }} | |
| needs: job-common | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| env: | |
| KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }} | |
| KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} | |
| KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} | |
| KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} | |
| SHORT_SHA: ${{ needs.job-common.outputs.SHORT_SHA }} | |
| steps: | |
| - name: checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # клонирует репозиторий с историей коммитов | |
| - name: setup jdk 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: cache gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/caches | |
| key: gradle-${{ runner.os }}-${{ hashFiles('/*.gradle*', '/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: cache gradle wrapper | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/wrapper | |
| key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
| - name: make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: decode keystore file | |
| id: decode_keystore_file | |
| uses: timheuer/base64-to-file@v1 | |
| with: | |
| fileName: 'keystore_release.jks' | |
| encodedString: ${{ secrets.KEYSTORE_FILE }} | |
| - name: set decoded file location as environment | |
| run: echo "KEYSTORE_FILE=${{ steps.decode_keystore_file.outputs.filePath }}" >> $GITHUB_ENV | |
| - name: assemble debug artifact | |
| run: ./gradlew wear:assembleDebug | |
| - name: assemble release artifact | |
| run: ./gradlew wear:assembleRelease | |
| - name: bundle release artifact | |
| run: ./gradlew wear:bundleRelease | |
| - name: upload artifacts to outputs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wear-build-${{ github.run_id }} | |
| path: | | |
| wear/build/outputs/apk/debug | |
| wear/build/outputs/apk/release | |
| wear/build/outputs/bundle/release | |
| - name: expose version name | |
| id: version_name | |
| run: | | |
| VERSION_NAME=$(./gradlew wear:printVersionName -q) | |
| echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV | |
| - name: expose version code | |
| id: version_code | |
| run: | | |
| VERSION_CODE=$(./gradlew wear:printVersionCode -q) | |
| echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV | |
| - name: expose artifacts | |
| run: | | |
| echo "DEBUG_APK_PATH=$(find wear/build/outputs/apk/debug -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| echo "RELEASE_APK_PATH=$(find wear/build/outputs/apk/release -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| echo "BUNDLE_APK_PATH=$(find wear/build/outputs/bundle/release -name '*.aab' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| - name: send telegram message debug | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ <b>${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})</b> | |
| <b>Branch:</b> <code>${{ github.ref_name }}</code> | |
| <b>Commit:</b> <code>${{ env.SHORT_SHA }}</code> | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.DEBUG_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="HTML" | |
| - name: send telegram message release | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ <b>${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})</b> | |
| <b>Branch:</b> <code>${{ github.ref_name }}</code> | |
| <b>Commit:</b> <code>${{ env.SHORT_SHA }}</code> | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.RELEASE_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="HTML" | |
| - name: send telegram message bundle | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ <b>${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})</b> | |
| <b>Branch:</b> <code>${{ github.ref_name }}</code> | |
| <b>Commit:</b> <code>${{ env.SHORT_SHA }}</code> | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.BUNDLE_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="HTML" | |
| build-tv: | |
| if: ${{ vars.TV_BUILD_ENABLED == 'true' }} | |
| needs: job-common | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| env: | |
| KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }} | |
| KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} | |
| KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} | |
| KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} | |
| SHORT_SHA: ${{ needs.job-common.outputs.SHORT_SHA }} | |
| steps: | |
| - name: checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # клонирует репозиторий с историей коммитов | |
| - name: setup jdk 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: cache gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/caches | |
| key: gradle-${{ runner.os }}-${{ hashFiles('/*.gradle*', '/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: cache gradle wrapper | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/wrapper | |
| key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
| - name: make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: decode keystore file | |
| id: decode_keystore_file | |
| uses: timheuer/base64-to-file@v1 | |
| with: | |
| fileName: 'keystore_release.jks' | |
| encodedString: ${{ secrets.KEYSTORE_FILE }} | |
| - name: set decoded file location as environment | |
| run: echo "KEYSTORE_FILE=${{ steps.decode_keystore_file.outputs.filePath }}" >> $GITHUB_ENV | |
| - name: assemble debug artifact | |
| run: ./gradlew tv:assembleDebug | |
| - name: assemble release artifact | |
| run: ./gradlew tv:assembleRelease | |
| - name: bundle release artifact | |
| run: ./gradlew tv:bundleRelease | |
| - name: upload artifacts to outputs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tv-build-${{ github.run_id }} | |
| path: | | |
| tv/build/outputs/apk/debug | |
| tv/build/outputs/apk/release | |
| tv/build/outputs/bundle/release | |
| - name: expose version name | |
| id: version_name | |
| run: | | |
| VERSION_NAME=$(./gradlew tv:printVersionName -q) | |
| echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV | |
| - name: expose version code | |
| id: version_code | |
| run: | | |
| VERSION_CODE=$(./gradlew tv:printVersionCode -q) | |
| echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV | |
| - name: expose artifacts | |
| run: | | |
| echo "DEBUG_APK_PATH=$(find tv/build/outputs/apk/debug -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| echo "RELEASE_APK_PATH=$(find tv/build/outputs/apk/release -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| echo "BUNDLE_APK_PATH=$(find tv/build/outputs/bundle/release -name '*.aab' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| - name: send telegram message debug | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ <b>${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})</b> | |
| <b>Branch:</b> <code>${{ github.ref_name }}</code> | |
| <b>Commit:</b> <code>${{ env.SHORT_SHA }}</code> | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.DEBUG_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="HTML" | |
| - name: send telegram message release | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ <b>${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})</b> | |
| <b>Branch:</b> <code>${{ github.ref_name }}</code> | |
| <b>Commit:</b> <code>${{ env.SHORT_SHA }}</code> | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.RELEASE_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="HTML" | |
| - name: send telegram message bundle | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ <b>${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})</b> | |
| <b>Branch:</b> <code>${{ github.ref_name }}</code> | |
| <b>Commit:</b> <code>${{ env.SHORT_SHA }}</code> | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.BUNDLE_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="HTML" | |
| build-auto: | |
| if: ${{ vars.AUTO_BUILD_ENABLED == 'true' }} | |
| needs: job-common | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| env: | |
| KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }} | |
| KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} | |
| KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} | |
| KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} | |
| SHORT_SHA: ${{ needs.job-common.outputs.SHORT_SHA }} | |
| steps: | |
| - name: checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: setup jdk 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: cache gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/caches | |
| key: gradle-${{ runner.os }}-${{ hashFiles('/*.gradle*', '/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: cache gradle wrapper | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/wrapper | |
| key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
| - name: make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: decode keystore file | |
| id: decode_keystore_file | |
| uses: timheuer/base64-to-file@v1 | |
| with: | |
| fileName: 'keystore_release.jks' | |
| encodedString: ${{ secrets.KEYSTORE_FILE }} | |
| - name: set decoded file location as environment | |
| run: echo "KEYSTORE_FILE=${{ steps.decode_keystore_file.outputs.filePath }}" >> $GITHUB_ENV | |
| - name: assemble debug artifact | |
| run: ./gradlew auto:assembleDebug | |
| - name: assemble release artifact | |
| run: ./gradlew auto:assembleRelease | |
| - name: bundle release artifact | |
| run: ./gradlew auto:bundleRelease | |
| - name: upload artifacts to outputs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: auto-build-${{ github.run_id }} | |
| path: | | |
| auto/build/outputs/apk/debug | |
| auto/build/outputs/apk/release | |
| auto/build/outputs/bundle/release | |
| - name: expose version name | |
| id: version_name | |
| run: | | |
| VERSION_NAME=$(./gradlew auto:printVersionName -q) | |
| echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV | |
| - name: expose version code | |
| id: version_code | |
| run: | | |
| VERSION_CODE=$(./gradlew auto:printVersionCode -q) | |
| echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV | |
| - name: expose artifacts | |
| run: | | |
| echo "DEBUG_APK_PATH=$(find auto/build/outputs/apk/debug -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| echo "RELEASE_APK_PATH=$(find auto/build/outputs/apk/release -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| echo "BUNDLE_APK_PATH=$(find auto/build/outputs/bundle/release -name '*.aab' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV | |
| - name: send telegram message debug | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ <b>${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})</b> | |
| <b>Branch:</b> <code>${{ github.ref_name }}</code> | |
| <b>Commit:</b> <code>${{ env.SHORT_SHA }}</code> | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.DEBUG_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="HTML" | |
| - name: send telegram message release | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ <b>${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})</b> | |
| <b>Branch:</b> <code>${{ github.ref_name }}</code> | |
| <b>Commit:</b> <code>${{ env.SHORT_SHA }}</code> | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.RELEASE_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="HTML" | |
| - name: send telegram message bundle | |
| env: | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }} | |
| MESSAGE: | | |
| ✅ <b>${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})</b> | |
| <b>Branch:</b> <code>${{ github.ref_name }}</code> | |
| <b>Commit:</b> <code>${{ env.SHORT_SHA }}</code> | |
| run: | | |
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \ | |
| -F chat_id="${CHAT_ID}" \ | |
| -F document="@${{ env.BUNDLE_APK_PATH }}" \ | |
| -F caption="${{ env.MESSAGE }}" \ | |
| -F message_thread_id="${THREAD_ID}" \ | |
| -F parse_mode="HTML" |