Skip to content

configured fastlane config #125

configured fastlane config

configured fastlane config #125

Workflow file for this run

name: PREVISION CI
on:
pull_request:
branches: [ main ] # Trigger for PRs to main branch
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
GOOGLE_MAPS_KEY: ${{ secrets.GOOGLE_MAPS_KEY }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_RELEASE_KEYSTORE: ${{ secrets.ANDROID_RELEASE_KEYSTORE }}
jobs:
android_build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Generate google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
echo "$GOOGLE_SERVICES_JSON" > google-services.json
mkdir -p android/app/src
mv google-services.json android/app/src
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Install dependencies
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
- name: Run Jetify
run: npx jetify
- name: Cache Gradle Wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Make Gradlew Executable
run: cd android && chmod +x ./gradlew
- name: Generate release keystore
run: |
echo "$ANDROID_RELEASE_KEYSTORE" > release.keystore.asc
gpg -d --passphrase "$ANDROID_KEYSTORE_PASSWORD" --batch release.keystore.asc > android/app/release.keystore
- name: Clean Gradle build
run: |
cd android && ./gradlew clean
- name: Increment Version Code and Name
run: |
VERSION_CODE=$(grep 'versionCode' android/app/build.gradle | sed 's/[^0-9]*//g')
NEW_VERSION_CODE=$((VERSION_CODE + 1))
sed -i "s/versionCode $VERSION_CODE/versionCode $NEW_VERSION_CODE/" android/app/build.gradle
VERSION_NAME=$(grep 'versionName' android/app/build.gradle | sed 's/versionName "//' | sed 's/"//')
NEW_VERSION_NAME=$(echo $VERSION_NAME | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')
sed -i "s/versionName \"$VERSION_NAME\"/versionName \"$NEW_VERSION_NAME\"/" android/app/build.gradle
- name: Build Android
run: |
cd android && ./gradlew bundleRelease
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.4'
- name: Deploy to Internal
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}
packageName: ${{ secrets.APP_IDENTIFIER }}
releaseFiles: android/app/build/outputs/bundle/release/app-release.aab
track: beta