Save telegram id and hash in shared preferences instead of hardcode #5
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: Sample app release build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| TELEGRAM_APP_ID: ${{ secrets.TELEGRAM_APP_ID }} | |
| TELEGRAM_APP_HASH: ${{ secrets.TELEGRAM_APP_HASH }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Build Release APK | |
| run: ./gradlew --no-daemon clean :sample:app:assembleRelease | |
| - name: Upload Build Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-artifacts | |
| path: sample/app/build/outputs/apk/release/app-release.apk | |
| retention-days: 1 | |
| distribute: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download Build Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-artifacts | |
| path: sample/app/build/outputs/apk/release | |
| - name: Install Firebase CLI | |
| run: | | |
| npm install -g firebase-tools | |
| firebase --version | |
| - name: Upload to Firebase (Manual CLI) | |
| env: | |
| FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} | |
| CREDENTIAL_CONTENT: ${{ secrets.FIREBASE_CREDENTIAL_FILE_CONTENT }} | |
| GOOGLE_APPLICATION_CREDENTIALS: service-account.json | |
| run: | | |
| echo "$CREDENTIAL_CONTENT" > service-account.json | |
| # CHANGED: Explicitly using app-release.apk | |
| APK_PATH="sample/app/build/outputs/apk/release/app-release.apk" | |
| if [ ! -f "$APK_PATH" ]; then | |
| echo "Error: APK not found at $APK_PATH" | |
| ls -R sample/app/build/outputs/apk/ | |
| exit 1 | |
| fi | |
| # 2. LOGIC: Determine release notes based on event type | |
| if [ "${{ github.event_name }}" == "pull_request" ]; then | |
| NOTES="PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}" | |
| else | |
| NOTES="Master Release: ${{ github.sha }}" | |
| fi | |
| firebase appdistribution:distribute "$APK_PATH" \ | |
| --app "$FIREBASE_APP_ID" \ | |
| --groups "testers" \ | |
| --release-notes "$NOTES" \ | |
| --debug | |
| - name: Publish GitHub release | |
| if: github.event_name == 'push' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: release-${{ github.run_number }} | |
| name: Release build #${{ github.run_number }} | |
| body: | | |
| Automated Release build for commit ${{ github.sha }} on master. | |
| This release contains the sample Compose client APK built from sample/app's Release variant. | |
| prerelease: false | |
| files: sample/app/build/outputs/apk/release/app-release.apk | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |