Bump API and Android app versions to 1.66.0 and 1.39.0 (code 156), re… #123
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: Android Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'android/app/build.gradle' | |
| - '.github/workflows/cd-android.yml' | |
| jobs: | |
| check-version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_build: ${{ steps.version_check.outputs.should_build }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Get previous versionCode | |
| id: prev_version | |
| run: | | |
| git checkout HEAD^ | |
| PREV=$(grep versionCode android/app/build.gradle | awk '{print $2}') | |
| echo "prev_version=$PREV" >> $GITHUB_OUTPUT | |
| git checkout - | |
| - name: Get current versionCode | |
| id: curr_version | |
| run: | | |
| CURR=$(grep versionCode android/app/build.gradle | awk '{print $2}') | |
| echo "curr_version=$CURR" >> $GITHUB_OUTPUT | |
| - name: Compare versionCodes | |
| id: version_check | |
| run: | | |
| if [ "${{ steps.curr_version.outputs.curr_version }}" -gt "${{ steps.prev_version.outputs.prev_version }}" ]; then | |
| echo "should_build=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "versionCode not increased. Skipping build." | |
| echo "should_build=false" >> $GITHUB_OUTPUT | |
| fi | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| needs: check-version | |
| if: needs.check-version.outputs.should_build == 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: gradle | |
| - name: Compile Web App into Android assets | |
| env: | |
| NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }} | |
| NEXT_PUBLIC_SUPABASE_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_KEY }} | |
| MEDIA_SOURCE_BASE_URL: ${{ vars.MEDIA_SOURCE_BASE_URL }} | |
| run: yarn build-sync-android | |
| - name: Build AAB | |
| run: | | |
| cd android | |
| echo "${{ secrets.ANDROID_GOOGLE_SERVICES_JSON }}" | base64 -d > app/google-services.json | |
| echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > release.keystore | |
| cp release.keystore app/release.keystore | |
| chmod +x gradlew | |
| ./gradlew bundleRelease \ | |
| -Pandroid.injected.signing.store.file=release.keystore \ | |
| -Pandroid.injected.signing.store.password=${{ secrets.ANDROID_KEYSTORE_PASSWORD }} \ | |
| -Pandroid.injected.signing.key.alias=compass \ | |
| -Pandroid.injected.signing.key.password=${{ secrets.ANDROID_KEY_PASSWORD }} | |
| - name: Upload to Play Store (Internal Track) | |
| uses: r0adkll/upload-google-play@v1 | |
| with: | |
| serviceAccountJsonPlainText: ${{ secrets.PLAY_SERVICE_ACCOUNT_JSON }} | |
| packageName: com.compassconnections.app | |
| releaseFiles: android/app/build/outputs/bundle/release/app-release.aab | |
| track: internal |