update pipeline variables

This commit is contained in:
Gergely Hegedus 2023-09-11 15:10:12 +03:00
parent 43df9b5db2
commit 0b46efff1f
6 changed files with 208 additions and 182 deletions

View file

@ -11,51 +11,45 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
cache: gradle
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
cache: 'npm' cache: 'npm'
- name: Set up Ruby & Fastlane
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.2.1'
bundler-cache: true
working-directory: ./android
- name: node_modules cache - name: node_modules cache
uses: actions/cache@v3 uses: actions/cache@v3
id: npm-cache id: npm-cache
with: with:
path: node_modules path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} restore-keys: ${{ runner.os }}-npm-
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: npm ci
- name: Restore Release Keystore
env: - name: Set up Ruby & Fastlane
keystore_base64: ${{ secrets.RELEASE_KEYSTORE_BASE64 }} uses: ruby/setup-ruby@v1
run: | with:
echo "$keystore_base64" | base64 --decode > release.keystore ruby-version: '3.2.1'
echo "CI_EVALUATION_KEYSTORE_FILE=`pwd`/release.keystore" >> $GITHUB_ENV bundler-cache: true
working-directory: ./android
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
# caching currently disabled, because the files are large, but don't decrease built time too much
#cache: gradle
- name: Restore Firebase Service Account - name: Restore Firebase Service Account
env: env:
firebase_service_account_base64: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_BASE64 }} firebase_service_account_base64: ${{ secrets.CI_EVAL_FIREBASE_DISTRIBUTION_AUTH_BASE64 }}
run: | run: |
echo "$firebase_service_account_base64" | base64 --decode > firebase-distribution-service-account.json echo "$firebase_service_account_base64" | base64 --decode > firebase-distribution-service-account.json
echo "CI_EVALUATION_FIREBASE_SERVICE_ACCOUNT_FILE=`pwd`/firebase-distribution-service-account.json" >> $GITHUB_ENV echo "CI_EVAL_FIREBASE_DISTRIBUTION_AUTH_FILE=`pwd`/firebase-distribution-service-account.json" >> $GITHUB_ENV
- name: Deploy to Firebase - name: Deploy to Firebase
env:
CI_EVALUATION_KEY_ALIAS: ${{ secrets.CI_EVALUATION_KEY_ALIAS }}
CI_EVALUATION_KEY_PASSWORD: ${{ secrets.CI_EVALUATION_KEY_PASSWORD }}
CI_EVALUATION_STORE_PASSWORD: ${{ secrets.CI_EVALUATION_STORE_PASSWORD }}
working-directory: ./android working-directory: ./android
run: bundle exec fastlane deployInternalFirebase run: bundle exec fastlane deployInternalToFirebase
ios-publish-to-firebase: ios-publish-to-firebase:
runs-on: macos-latest runs-on: macos-latest
@ -69,12 +63,6 @@ jobs:
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
cache: 'npm' cache: 'npm'
- name: Set up Ruby & Fastlane
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.2.1'
bundler-cache: true
working-directory: ./ios
- name: node_modules cache - name: node_modules cache
uses: actions/cache@v3 uses: actions/cache@v3
id: npm-cache id: npm-cache
@ -84,6 +72,13 @@ jobs:
restore-keys: ${{ runner.os }}-npm- restore-keys: ${{ runner.os }}-npm-
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: npm ci
- name: Set up Ruby & Fastlane
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.1'
bundler-cache: true
working-directory: ./ios
- name: pod install cache - name: pod install cache
uses: actions/cache@v3 uses: actions/cache@v3
id: pod-cache id: pod-cache
@ -94,29 +89,31 @@ jobs:
- name: Install iOS Dependencies - name: Install iOS Dependencies
working-directory: ./ios working-directory: ./ios
run: pod install run: pod install
- name: Restore Firebase Service Account - name: Restore Firebase Service Account
env: env:
firebase_service_account_base64: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_BASE64 }} firebase_service_account_base64: ${{ secrets.CI_EVAL_FIREBASE_DISTRIBUTION_AUTH_BASE64 }}
run: | run: |
echo "$firebase_service_account_base64" | base64 --decode > firebase-distribution-service-account.json echo "$firebase_service_account_base64" | base64 --decode > firebase-distribution-service-account.json
echo "CI_EVALUATION_FIREBASE_SERVICE_ACCOUNT_FILE=`pwd`/firebase-distribution-service-account.json" >> $GITHUB_ENV echo "CI_EVAL_FIREBASE_DISTRIBUTION_AUTH_FILE=`pwd`/firebase-distribution-service-account.json" >> $GITHUB_ENV
- name: Restore Provisioning Profile
- name: Restore Internal Provisioning Profile
env: env:
ci_evaluation_provision_profile_base64: ${{ secrets.CI_EVALUATION_PROVISION_PROFILE_BASE64 }} provision_profile_base64: ${{ secrets.CI_EVAL_IOS_PROVISIONING_PROFILE_INTERNAL_BASE64 }}
run: | run: |
echo "$ci_evaluation_provision_profile_base64" | base64 --decode > profile.mobileprovision
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/profile.mobileprovision echo "$provision_profile_base64" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/internal_profile.mobileprovision
echo "CI_EVALUATION_PROVISIONING_PROFILE_FILE=\"~/Library/MobileDevice/Provisioning Profiles/profile.mobileprovision\"" >> $GITHUB_ENV echo "CI_EVAL_IOS_PROVISIONING_PROFILE_INTERNAL_FILENAME=internal_profile.mobileprovision" >> $GITHUB_ENV
- name: Restore iOS Cert - name: Restore iOS Cert
env: env:
ci_evaluation_cert_base64: ${{ secrets.CI_EVALUATION_CERT_BASE64 }} ios_cert_base64: ${{ secrets.CI_EVAL_IOS_CERT_BASE64 }}
run: | run: |
echo "$ci_evaluation_cert_base64" | base64 --decode > ios_distribution.p12 echo "$ios_cert_base64" | base64 --decode > ios_distribution.p12
echo "CI_EVALUATION_IOS_CERT_FILE=`pwd`/ios_distribution.p12" >> $GITHUB_ENV echo "CI_EVAL_IOS_CERT_FILE=`pwd`/ios_distribution.p12" >> $GITHUB_ENV
- name: Deploy to Firebase - name: Deploy to Firebase
env: env:
CI_EVALUATION_CERTIFICATE_PASSWORD: ${{ secrets.CI_EVALUATION_CERTIFICATE_PASSWORD }} CI_EVAL_IOS_CERT_PASSWORD: ${{ secrets.CI_EVAL_IOS_CERT_PASSWORD }}
CI_EVALUATION_APP_IDENTIFIER: ${{ secrets.CI_EVALUATION_APP_IDENTIFIER }} CI_EVAL_INTERNAL_APP_IDENTIFIER: ${{ secrets.CI_EVAL_INTERNAL_APP_IDENTIFIER }}
working-directory: ./ios working-directory: ./ios
run: bundle exec fastlane deployInternalFirebase run: bundle exec fastlane deployInternalToFirebase

View file

@ -11,51 +11,54 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
cache: gradle
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
cache: 'npm' cache: 'npm'
- name: Set up Ruby & Fastlane
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.2.1'
bundler-cache: true
working-directory: ./android
- name: node_modules cache - name: node_modules cache
uses: actions/cache@v3 uses: actions/cache@v3
id: npm-cache id: npm-cache
with: with:
path: node_modules path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} restore-keys: ${{ runner.os }}-npm-
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: npm ci
- name: Set up Ruby & Fastlane
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.1'
bundler-cache: true
working-directory: ./android
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
# caching currently disabled, because the files are large, but don't decrease built time too much
#cache: gradle
- name: Restore Release Keystore - name: Restore Release Keystore
env: env:
keystore_base64: ${{ secrets.RELEASE_KEYSTORE_BASE64 }} keystore_base64: ${{ secrets.CI_EVAL_ANDROID_KEYSTORE_BASE64 }}
run: | run: |
echo "$keystore_base64" | base64 --decode > release.keystore echo "$keystore_base64" | base64 --decode > release.keystore
echo "CI_EVALUATION_KEYSTORE_FILE=`pwd`/release.keystore" >> $GITHUB_ENV echo "CI_EVAL_ANDROID_KEYSTORE_FILE=`pwd`/release.keystore" >> $GITHUB_ENV
- name: Restore PlayStore Service Account - name: Restore PlayStore Service Account
env: env:
play_store_service_account_base64: ${{ secrets.PLAY_STORE_SERVICE_ACCOUNT_BASE64 }} play_store_service_account_base64: ${{ secrets.CI_EVAL_ANDROID_PLAY_STORE_AUTH_BASE64 }}
run: | run: |
echo "$play_store_service_account_base64" | base64 --decode > play-store-distribution-service-account.json echo "$play_store_service_account_base64" | base64 --decode > play-store-distribution-service-account.json
echo "CI_EVALUATION_PLAYSTORE_SERVICE_ACCOUNT_FILE=`pwd`/play-store-distribution-service-account.json" >> $GITHUB_ENV echo "CI_EVAL_ANDROID_PLAY_STORE_AUTH_FILE=`pwd`/play-store-distribution-service-account.json" >> $GITHUB_ENV
- name: Deploy to Play Store Internal Track - name: Deploy to Play Store Internal Track
env: env:
CI_EVALUATION_KEY_ALIAS: ${{ secrets.CI_EVALUATION_KEY_ALIAS }} CI_EVAL_ANDROID_KEYSTORE_KEY_ALIAS: ${{ secrets.CI_EVAL_ANDROID_KEYSTORE_KEY_ALIAS }}
CI_EVALUATION_KEY_PASSWORD: ${{ secrets.CI_EVALUATION_KEY_PASSWORD }} CI_EVAL_ANDROID_KEYSTORE_KEY_PASSWORD: ${{ secrets.CI_EVAL_ANDROID_KEYSTORE_KEY_PASSWORD }}
CI_EVALUATION_STORE_PASSWORD: ${{ secrets.CI_EVALUATION_STORE_PASSWORD }} CI_EVAL_ANDROID_KEYSTORE_STORE_PASSWORD: ${{ secrets.CI_EVAL_ANDROID_KEYSTORE_STORE_PASSWORD }}
working-directory: ./android working-directory: ./android
run: bundle exec fastlane deployProdPlayStore run: bundle exec fastlane deployProdToPlayStore
ios-publish-to-testflight: ios-publish-to-testflight:
runs-on: macos-latest runs-on: macos-latest
@ -69,12 +72,6 @@ jobs:
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
cache: 'npm' cache: 'npm'
- name: Set up Ruby & Fastlane
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.2.1'
bundler-cache: true
working-directory: ./ios
- name: node_modules cache - name: node_modules cache
uses: actions/cache@v3 uses: actions/cache@v3
id: npm-cache id: npm-cache
@ -84,6 +81,13 @@ jobs:
restore-keys: ${{ runner.os }}-npm- restore-keys: ${{ runner.os }}-npm-
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: npm ci
- name: Set up Ruby & Fastlane
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.1'
bundler-cache: true
working-directory: ./ios
- name: pod install cache - name: pod install cache
uses: actions/cache@v3 uses: actions/cache@v3
id: pod-cache id: pod-cache
@ -94,31 +98,33 @@ jobs:
- name: Install iOS Dependencies - name: Install iOS Dependencies
working-directory: ./ios working-directory: ./ios
run: pod install run: pod install
- name: Restore Provisioning Profile
- name: Restore Prod Provisioning Profile
env: env:
ci_evaluation_provision_profile_base64: ${{ secrets.CI_EVALUATION_APPSTORE_PROVISION_PROFILE_BASE64 }} provision_profile_base64: ${{ secrets.CI_EVAL_IOS_PROVISIONING_PROFILE_PROD_BASE64 }}
run: | run: |
echo "$ci_evaluation_provision_profile_base64" | base64 --decode > profile.mobileprovision
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/profile.mobileprovision echo "$provision_profile_base64" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/prod_profile.mobileprovision
echo "CI_EVALUATION_PROVISIONING_PROFILE_FILE=\"~/Library/MobileDevice/Provisioning Profiles/profile.mobileprovision\"" >> $GITHUB_ENV echo "CI_EVAL_IOS_PROVISIONING_PROFILE_PROD_FILENAME=prod_profile.mobileprovision" >> $GITHUB_ENV
- name: Restore iOS Cert - name: Restore iOS Cert
env: env:
ci_evaluation_cert_base64: ${{ secrets.CI_EVALUATION_CERT_BASE64 }} ios_cert_base64: ${{ secrets.CI_EVAL_IOS_CERT_BASE64 }}
run: | run: |
echo "$ci_evaluation_cert_base64" | base64 --decode > ios_distribution.p12 echo "$ios_cert_base64" | base64 --decode > ios_distribution.p12
echo "CI_EVALUATION_IOS_CERT_FILE=`pwd`/ios_distribution.p12" >> $GITHUB_ENV echo "CI_EVAL_IOS_CERT_FILE=`pwd`/ios_distribution.p12" >> $GITHUB_ENV
- name: Restore App Store API Key - name: Restore App Store API Key
env: env:
app_store_api_key_base64: ${{ secrets.APP_STORE_API_KEY_BASE64 }} app_store_api_key_base64: ${{ secrets.CI_EVAL_IOS_APP_STORE_KEY_FILE_BASE64 }}
run: | run: |
echo "$app_store_api_key_base64" | base64 --decode > api_key.p8 echo "$app_store_api_key_base64" | base64 --decode > api_key.p8
echo "CI_EVALUATION_APP_STORE_API_KEY_FILE=`pwd`/api_key.p8" >> $GITHUB_ENV echo "CI_EVAL_IOS_APP_STORE_KEY_FILE=`pwd`/api_key.p8" >> $GITHUB_ENV
- name: Deploy to TestFlight - name: Deploy to TestFlight
env: env:
CI_EVALUATION_APP_STORE_API_KEY_ID: ${{ secrets.CI_EVALUATION_APP_STORE_API_KEY_ID }} CI_EVAL_IOS_CERT_PASSWORD: ${{ secrets.CI_EVAL_IOS_CERT_PASSWORD }}
CI_EVALUATION_APP_STORE_API_KEY_ISSUER_ID: ${{ secrets.CI_EVALUATION_APP_STORE_API_KEY_ISSUER_ID }} CI_EVAL_IOS_APP_STORE_KEY_ID: ${{ secrets.CI_EVAL_IOS_APP_STORE_KEY_ID }}
CI_EVALUATION_CERTIFICATE_PASSWORD: ${{ secrets.CI_EVALUATION_CERTIFICATE_PASSWORD }} CI_EVAL_IOS_APP_STORE_KEY_ISSUER_ID: ${{ secrets.CI_EVAL_IOS_APP_STORE_KEY_ISSUER_ID }}
CI_EVALUATION_APP_IDENTIFIER: ${{ secrets.CI_EVALUATION_APP_IDENTIFIER }} CI_EVAL_PROD_APP_IDENTIFIER: ${{ secrets.CI_EVAL_PROD_APP_IDENTIFIER }}
working-directory: ./ios working-directory: ./ios
run: bundle exec fastlane deployToTestFlight run: bundle exec fastlane deployToTestFlight

View file

@ -12,7 +12,7 @@ jobs:
contents: read contents: read
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
@ -27,6 +27,7 @@ jobs:
restore-keys: ${{ runner.os }}-npm- restore-keys: ${{ runner.os }}-npm-
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: npm ci
- name: Run Tests - name: Run Tests
run: npm run test run: npm run test
@ -37,7 +38,7 @@ jobs:
contents: read contents: read
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
@ -54,24 +55,20 @@ jobs:
run: npm ci run: npm ci
- name: Set up Ruby & Fastlane - name: Set up Ruby & Fastlane
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: '3.2.1' ruby-version: '3.2.1'
bundler-cache: true bundler-cache: true
working-directory: ./android working-directory: ./android
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
# caching currently disabled, because the files are large, but don't decrease built time too much
#cache: gradle
- name: Restore Release Keystore - name: Build APK
env:
keystore_base64: ${{ secrets.RELEASE_KEYSTORE_BASE64 }}
run: |
echo "$keystore_base64" | base64 --decode > release.keystore
echo "CI_EVALUATION_KEYSTORE_FILE=`pwd`/release.keystore" >> $GITHUB_ENV
- name: Build Release APK
env:
CI_EVALUATION_KEY_ALIAS: ${{ secrets.CI_EVALUATION_KEY_ALIAS }}
CI_EVALUATION_KEY_PASSWORD: ${{ secrets.CI_EVALUATION_KEY_PASSWORD }}
CI_EVALUATION_STORE_PASSWORD: ${{ secrets.CI_EVALUATION_STORE_PASSWORD }}
working-directory: ./android working-directory: ./android
run: bundle exec fastlane buildReleaseApk run: bundle exec fastlane buildReleaseApk
@ -82,7 +79,7 @@ jobs:
contents: read contents: read
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
@ -99,12 +96,11 @@ jobs:
run: npm ci run: npm ci
- name: Set up Ruby & Fastlane - name: Set up Ruby & Fastlane
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: '3.2.1' ruby-version: '3.2.1'
bundler-cache: true bundler-cache: true
working-directory: ./ios working-directory: ./ios
- name: pod install cache - name: pod install cache
uses: actions/cache@v3 uses: actions/cache@v3
id: pod-cache id: pod-cache
@ -116,24 +112,23 @@ jobs:
working-directory: ./ios working-directory: ./ios
run: pod install run: pod install
- name: Restore Provisioning Profile - name: Restore Internal Provisioning Profile
env: env:
ci_evaluation_provision_profile_base64: ${{ secrets.CI_EVALUATION_PROVISION_PROFILE_BASE64 }} provision_profile_base64: ${{ secrets.CI_EVAL_IOS_PROVISIONING_PROFILE_INTERNAL_BASE64 }}
run: | run: |
echo "$ci_evaluation_provision_profile_base64" | base64 --decode > profile.mobileprovision
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/profile.mobileprovision echo "$provision_profile_base64" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/internal_profile.mobileprovision
echo "CI_EVALUATION_PROVISIONING_PROFILE_FILE=\"~/Library/MobileDevice/Provisioning Profiles/profile.mobileprovision\"" >> $GITHUB_ENV echo "CI_EVAL_IOS_PROVISIONING_PROFILE_INTERNAL_FILENAME=internal_profile.mobileprovision" >> $GITHUB_ENV
- name: Restore iOS Cert - name: Restore iOS Cert
env: env:
ci_evaluation_cert_base64: ${{ secrets.CI_EVALUATION_CERT_BASE64 }} ios_cert_base64: ${{ secrets.CI_EVAL_IOS_CERT_BASE64 }}
run: | run: |
echo "$ci_evaluation_cert_base64" | base64 --decode > ios_distribution.p12 echo "$ios_cert_base64" | base64 --decode > ios_distribution.p12
echo "CI_EVALUATION_IOS_CERT_FILE=`pwd`/ios_distribution.p12" >> $GITHUB_ENV echo "CI_EVAL_IOS_CERT_FILE=`pwd`/ios_distribution.p12" >> $GITHUB_ENV
- name: Build Release IPA - name: Build Release IPA
env: env:
CI_EVALUATION_CERTIFICATE_PASSWORD: ${{ secrets.CI_EVALUATION_CERTIFICATE_PASSWORD }} CI_EVAL_IOS_CERT_PASSWORD: ${{ secrets.CI_EVAL_IOS_CERT_PASSWORD }}
CI_EVALUATION_APP_IDENTIFIER: ${{ secrets.CI_EVALUATION_APP_IDENTIFIER }} CI_EVAL_INTERNAL_APP_IDENTIFIER: ${{ secrets.CI_EVAL_INTERNAL_APP_IDENTIFIER }}
working-directory: ./ios working-directory: ./ios
run: bundle exec fastlane buildReleaseIPA run: bundle exec fastlane buildReleaseIPA

View file

@ -73,6 +73,7 @@ def jscFlavor = 'org.webkit:android-jsc:+'
// custom properties // custom properties
def applicationIdArgument = project.findProperty('applicationId') def applicationIdArgument = project.findProperty('applicationId')
def applicationVersionCodeArgument = project.findProperty('versionCode')?.toInteger() def applicationVersionCodeArgument = project.findProperty('versionCode')?.toInteger()
def useDebugSigningForReleaseBuild = project.findProperty('useDebugSigningForReleaseBuild')?.toBoolean() ?: false
android { android {
ndkVersion rootProject.ext.ndkVersion ndkVersion rootProject.ext.ndkVersion
@ -95,10 +96,10 @@ android {
keyPassword 'android' keyPassword 'android'
} }
release { release {
storeFile file(System.getenv("CI_EVALUATION_KEYSTORE_FILE") ?: 'debug.keystore') storeFile file(System.getenv("CI_EVAL_ANDROID_KEYSTORE_FILE") ?: 'debug.keystore')
keyAlias System.getenv("CI_EVALUATION_KEY_ALIAS") ?: '' keyAlias System.getenv("CI_EVAL_ANDROID_KEYSTORE_KEY_ALIAS") ?: ''
keyPassword System.getenv("CI_EVALUATION_KEY_PASSWORD") ?: '' keyPassword System.getenv("CI_EVAL_ANDROID_KEYSTORE_KEY_PASSWORD") ?: ''
storePassword System.getenv("CI_EVALUATION_STORE_PASSWORD") ?: '' storePassword System.getenv("CI_EVAL_ANDROID_KEYSTORE_STORE_PASSWORD") ?: ''
} }
} }
buildTypes { buildTypes {
@ -108,7 +109,11 @@ android {
release { release {
// Caution! In production, you need to generate your own keystore file. // Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android. // see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.release if (useDebugSigningForReleaseBuild) {
signingConfig signingConfigs.debug
} else {
signingConfig signingConfigs.release
}
minifyEnabled enableProguardInReleaseBuilds minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
} }

View file

@ -18,22 +18,24 @@ default_platform(:android)
platform :android do platform :android do
before_all do before_all do
# Firebase's internal app id, find it on the Firebase website FIREBASE_DISTRIBUTION_INTERNAL_APP = "1:64659984801:android:7a0514333a32b8c5f43be0"
FIREBASE_APP_DISTRIBUTION_APP_STAGING = "1:64659984801:android:7a0514333a32b8c5f43be0"
# Firebase's testing group
FIREBASE_APP_DISTRIBUTION_GROUPS_QA = "android-qa" FIREBASE_APP_DISTRIBUTION_GROUPS_QA = "android-qa"
# Environment variable, service account key to authenticate with firebase INTERNAL_APP_IDENTIFIER = "com.initproject.staging"
FIREBASE_SERVICE_ACCOUNT_FILE = ENV['CI_EVALUATION_FIREBASE_SERVICE_ACCOUNT_FILE'] PROD_APP_IDENTIFIER = "com.initproject.prod"
# Environment variable, service account key to authenticate with PlayStore
PLAYSTORE_SERVICE_ACCOUNT_FILE = ENV['CI_EVALUATION_PLAYSTORE_SERVICE_ACCOUNT_FILE'] # Environment variable should be the full path to the firebase auth .json
FIREBASE_DISTRIBUTION_AUTH_FILE = ENV['CI_EVAL_FIREBASE_DISTRIBUTION_AUTH_FILE']
# Environment variable should be the full path to the PlayStore auth .json
PLAY_STORE_AUTH_FILE = ENV['CI_EVAL_ANDROID_PLAY_STORE_AUTH_FILE']
end end
desc "Submit a new Internal Build to Firebase" desc "Submit a new Internal Build to Firebase"
desc ">Optionally release notes can be added like so:" desc ">Optionally release notes can be added like so:"
desc "```sh" desc "```sh"
desc "[bundle exec] fastlane deployInternalFirebase release_notes:\"testing notes\"" desc "[bundle exec] fastlane deployInternalToFirebase release_notes:\"testing notes\""
desc "```" desc "```"
lane :deployInternalFirebase do |options| lane :deployInternalToFirebase do |options|
release_notes = options[:release_notes] release_notes = options[:release_notes]
if release_notes.nil? if release_notes.nil?
commit = last_git_commit commit = last_git_commit
@ -44,8 +46,8 @@ platform :android do
internal_apk = lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS].find{ |i| i[/app-*release*.apk/] } internal_apk = lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS].find{ |i| i[/app-*release*.apk/] }
firebase_app_distribution( firebase_app_distribution(
service_credentials_file: FIREBASE_SERVICE_ACCOUNT_FILE, service_credentials_file: FIREBASE_DISTRIBUTION_AUTH_FILE,
app: FIREBASE_APP_DISTRIBUTION_APP_STAGING, app: FIREBASE_DISTRIBUTION_INTERNAL_APP,
groups: FIREBASE_APP_DISTRIBUTION_GROUPS_QA, groups: FIREBASE_APP_DISTRIBUTION_GROUPS_QA,
android_artifact_type: 'APK', android_artifact_type: 'APK',
android_artifact_path: internal_apk, android_artifact_path: internal_apk,
@ -62,7 +64,8 @@ platform :android do
build_type: 'release', build_type: 'release',
flags: "--no-daemon", flags: "--no-daemon",
properties: { properties: {
"applicationId" => "com.initproject.staging" "applicationId" => INTERNAL_APP_IDENTIFIER,
"useDebugSigningForReleaseBuild" => "true"
} }
) )
end end
@ -71,16 +74,16 @@ platform :android do
desc "By Default it sets the version_code to last from PlayStore + 1." desc "By Default it sets the version_code to last from PlayStore + 1."
desc ">Optionally version code increase can be skipped via:" desc ">Optionally version code increase can be skipped via:"
desc "```sh" desc "```sh"
desc "[bundle exec] fastlane deployInternalFirebase skip_build_number_increase:1" desc "[bundle exec] fastlane deployProdToPlayStore skip_build_number_increase:1"
desc "```" desc "```"
lane :deployProdPlayStore do |options| lane :deployProdToPlayStore do |options|
skip_build_number_increase = options[:skip_build_number_increase] # optional, if not set, it gets the last from TestFlight then adds + 1 skip_build_number_increase = options[:skip_build_number_increase] # optional, if not set, it gets the last from PlayStore then adds + 1
package_name = "com.initproject.prod" package_name = PROD_APP_IDENTIFIER
if skip_build_number_increase.nil? if skip_build_number_increase.nil?
last_version_codes = google_play_track_version_codes( last_version_codes = google_play_track_version_codes(
track: 'internal', track: 'internal',
json_key: PLAYSTORE_SERVICE_ACCOUNT_FILE, json_key: PLAY_STORE_AUTH_FILE,
package_name: package_name package_name: package_name
) )
last_version_code = last_version_codes[0] last_version_code = last_version_codes[0]
@ -93,6 +96,7 @@ platform :android do
build_type: 'release', build_type: 'release',
flags: "--no-daemon", flags: "--no-daemon",
properties: { properties: {
"applicationId" => PROD_APP_IDENTIFIER,
"versionCode" => version_code "versionCode" => version_code
} }
) )
@ -102,7 +106,7 @@ platform :android do
track: 'internal', track: 'internal',
release_status: 'draft', # can remove once app is released to the public release_status: 'draft', # can remove once app is released to the public
aab: production_aab, aab: production_aab,
json_key: PLAYSTORE_SERVICE_ACCOUNT_FILE, json_key: PLAY_STORE_AUTH_FILE,
skip_upload_apk: true, skip_upload_apk: true,
package_name: package_name, package_name: package_name,
) )

View file

@ -18,38 +18,41 @@ default_platform(:ios)
platform :ios do platform :ios do
before_all do before_all do
# Firebase's internal app id, find it on the Firebase website FIREBASE_DISTRIBUTION_INTERNAL_APP = "1:64659984801:ios:a9c4640d2a1960a5f43be0"
FIREBASE_APP_DISTRIBUTION_APP_STAGING = "1:64659984801:ios:a9c4640d2a1960a5f43be0"
# Firebase's testing group
FIREBASE_APP_DISTRIBUTION_GROUPS_QA = "ios-qa" FIREBASE_APP_DISTRIBUTION_GROUPS_QA = "ios-qa"
# name of the keychain created while signing
KEYCHAIN_NAME = "temp_keychain" KEYCHAIN_NAME = "temp_keychain"
INTERNAL_APP_IDENTIFIER = ENV['CI_EVAL_INTERNAL_APP_IDENTIFIER']
PROD_APP_IDENTIFIER = ENV['CI_EVAL_PROD_APP_IDENTIFIER']
APP_TARGET = "InitProject"
# Environment variable should be the full path to the firebase auth .json
FIREBASE_DISTRIBUTION_AUTH_FILE = ENV['CI_EVAL_FIREBASE_DISTRIBUTION_AUTH_FILE']
# provisioning profiles, they are under a specific folder
# filename come from environment variable
provisioning_profile_folder = "#{ENV['HOME']}/Library/MobileDevice/Provisioning Profiles"
internal_provisioning_profile_name = ENV['CI_EVAL_IOS_PROVISIONING_PROFILE_INTERNAL_FILENAME']
INTERNAL_PROVISIONING_PROFILE_FILE = "#{provisioning_profile_folder}/#{internal_provisioning_profile_name}"
prod_provisioning_profile_name = ENV['CI_EVAL_IOS_PROVISIONING_PROFILE_PROD_FILENAME']
PROD_PROVISIONING_PROFILE_FILE = "#{provisioning_profile_folder}/#{prod_provisioning_profile_name}"
# Environment variable, service account key to authenticate with firebase
FIREBASE_SERVICE_ACCOUNT_FILE = ENV['CI_EVALUATION_FIREBASE_SERVICE_ACCOUNT_FILE']
# full path to the signing certificate. Created on the Apple Developer portal, then exported from keychain, usually as p12. # full path to the signing certificate. Created on the Apple Developer portal, then exported from keychain, usually as p12.
IOS_CERT_FILE = ENV['CI_EVALUATION_IOS_CERT_FILE'] IOS_CERT_FILE = ENV['CI_EVAL_IOS_CERT_FILE']
# password to the certificate # password to the certificate
CERTIFICATE_PASSWORD = ENV['CI_EVALUATION_CERTIFICATE_PASSWORD'].strip CERTIFICATE_PASSWORD = ENV['CI_EVAL_IOS_CERT_PASSWORD'].strip
# full path to the provisioning profile, the file name comes from Environment variable
# created on the Apple Developer portal # App Api Key File Path, created on https://appstoreconnect.apple.com/access/api
PROVISIONING_PROFILE_FILE = "#{ENV['HOME']}/Library/MobileDevice/Provisioning Profiles/profile.mobileprovision" APP_STORE_API_KEY_FILE = ENV['CI_EVAL_IOS_APP_STORE_KEY_FILE']
# App identifier Environment variable, copied from the Apple Developer portal APP_STORE_API_KEY_ID = ENV['CI_EVAL_IOS_APP_STORE_KEY_ID']
APP_IDENTIFIER = ENV['CI_EVALUATION_APP_IDENTIFIER'] APP_STORE_API_KEY_ISSUER_ID = ENV['CI_EVAL_IOS_APP_STORE_KEY_ISSUER_ID']
# App Api Key File, created on the Apple Developer portal
APP_STORE_API_KEY_FILE = ENV['CI_EVALUATION_APP_STORE_API_KEY_FILE']
# App KeyId Environment variable, copied from the Apple Developer portal
APP_STORE_API_KEY_ID = ENV['CI_EVALUATION_APP_STORE_API_KEY_ID']
# App Key Issuer Environment variable, copied from the Apple Developer portal
APP_STORE_API_KEY_ISSUER_ID = ENV['CI_EVALUATION_APP_STORE_API_KEY_ISSUER_ID']
end end
desc "Creates Release Signed build and publishes it to firebase" desc "Creates Release Signed build and publishes it to firebase"
desc ">Optionally release notes can be added like so:" desc ">Optionally release notes can be added like so:"
desc "```sh" desc "```sh"
desc "[bundle exec] fastlane deployInternalFirebase release_notes:\"testing notes\"" desc "[bundle exec] fastlane deployInternalToFirebase release_notes:\"testing notes\""
desc "```" desc "```"
lane :deployInternalFirebase do |options| lane :deployInternalToFirebase do |options|
release_notes = options[:release_notes] release_notes = options[:release_notes]
if release_notes.nil? if release_notes.nil?
commit = last_git_commit commit = last_git_commit
@ -57,16 +60,20 @@ platform :ios do
end end
ipa_name = "Internal.ipa" ipa_name = "Internal.ipa"
buildReleaseIPA(ipa_name: ipa_name, method: "ad-hoc") buildReleaseIPA(
ipa_name: ipa_name,
method: "ad-hoc",
profile: INTERNAL_PROVISIONING_PROFILE_FILE,
app_identifier: INTERNAL_APP_IDENTIFIER,
)
firebase_app_distribution( firebase_app_distribution(
service_credentials_file: FIREBASE_SERVICE_ACCOUNT_FILE, service_credentials_file: FIREBASE_DISTRIBUTION_AUTH_FILE,
app: FIREBASE_APP_DISTRIBUTION_APP_STAGING, app: FIREBASE_DISTRIBUTION_INTERNAL_APP,
groups: FIREBASE_APP_DISTRIBUTION_GROUPS_QA, groups: FIREBASE_APP_DISTRIBUTION_GROUPS_QA,
ipa_path: "builds/#{ipa_name}", ipa_path: "builds/#{ipa_name}",
release_notes: "#{release_notes}", release_notes: "#{release_notes}",
) )
cleanupKeyChain()
end end
desc "Submit a new Production Build to TestFlight" desc "Submit a new Production Build to TestFlight"
@ -87,37 +94,39 @@ platform :ios do
if skip_build_number_increase.nil? if skip_build_number_increase.nil?
increment_build_number({ increment_build_number({
build_number: latest_testflight_build_number(app_identifier: APP_IDENTIFIER) + 1 build_number: latest_testflight_build_number(app_identifier: PROD_APP_IDENTIFIER) + 1
}) })
end end
setupCodeSigning()
ipa_name = "Release.ipa" ipa_name = "Release.ipa"
buildReleaseIPA(ipa_name: ipa_name, method: "app-store") buildReleaseIPA(
ipa_name: ipa_name,
method: "app-store",
profile: PROD_PROVISIONING_PROFILE_FILE,
app_identifier: PROD_APP_IDENTIFIER,
)
upload_to_testflight( upload_to_testflight(
skip_submission: true, skip_submission: true,
ipa: "./builds/#{ipa_name}", ipa: "./builds/#{ipa_name}",
skip_waiting_for_build_processing: true, skip_waiting_for_build_processing: true,
) )
cleanupKeyChain()
end end
desc "Create new Release IPA" desc "Create new Release IPA"
desc "Find it under ios/builds" desc "Find it under ios/builds"
lane :buildReleaseIPA do |options| lane :buildReleaseIPA do |options|
ipa_name = options[:ipa_name] ipa_name = options[:ipa_name] || "InternalBuild.ipa"
method = options[:method] method = options[:method] || "ad-hoc"
if ipa_name.nil? profile = options[:profile] || INTERNAL_PROVISIONING_PROFILE_FILE
ipa_name = "InternalBuild.ipa" app_identifier = options[:app_identifier] || INTERNAL_APP_IDENTIFIER
end
if method.nil?
method = "ad-hoc"
end
setupCodeSigning()
setupCodeSigning(
profile: profile,
app_identifier: app_identifier,
)
build_app( build_app(
scheme: "InitProject", scheme: APP_TARGET,
export_method: method, export_method: method,
output_directory: "./builds", output_directory: "./builds",
output_name: ipa_name output_name: ipa_name
@ -126,7 +135,9 @@ platform :ios do
desc "Sets up the and initialises the required authentications and project configurations to sign a build" desc "Sets up the and initialises the required authentications and project configurations to sign a build"
desc "Creates a temporary keychain which should be deleted at the end, see :cleanupKeyChain" desc "Creates a temporary keychain which should be deleted at the end, see :cleanupKeyChain"
lane :setupCodeSigning do lane :setupCodeSigning do |options|
profile = options[:profile]
app_identifier = options[:app_identifier]
password = (0...50).map { ('a'..'z').to_a[rand(26)] }.join password = (0...50).map { ('a'..'z').to_a[rand(26)] }.join
cleanupKeyChain() cleanupKeyChain()
create_keychain( create_keychain(
@ -138,6 +149,7 @@ platform :ios do
add_to_search_list: true, add_to_search_list: true,
password: password password: password
) )
import_certificate( import_certificate(
certificate_path: IOS_CERT_FILE, certificate_path: IOS_CERT_FILE,
keychain_name: KEYCHAIN_NAME, keychain_name: KEYCHAIN_NAME,
@ -146,18 +158,25 @@ platform :ios do
log_output: true log_output: true
) )
update_app_identifier( update_app_identifier(
plist_path: "InitProject/Info.plist", plist_path: "#{APP_TARGET}/Info.plist",
app_identifier: APP_IDENTIFIER app_identifier: app_identifier
) )
update_project_provisioning( update_project_provisioning(
xcodeproj: "InitProject.xcodeproj", xcodeproj: "#{APP_TARGET}.xcodeproj",
target_filter: "InitProject", target_filter: "#{APP_TARGET}",
profile: PROVISIONING_PROFILE_FILE, profile: profile,
build_configuration: "Release" build_configuration: "Release"
) )
update_project_team( # Set the right team on your project update_project_team( # Set the right team on your project
teamid: CredentialsManager::AppfileConfig.try_fetch_value(:team_id) teamid: CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
) )
update_code_signing_settings(
use_automatic_signing: false,
code_sign_identity: "iPhone Distribution",
path: "#{APP_TARGET}.xcodeproj",
sdk: "iphoneos*"
)
unlock_keychain( unlock_keychain(
path: KEYCHAIN_NAME, path: KEYCHAIN_NAME,
password: password password: password