generated from nimblehq/git-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf3cd8a
commit d29e8c3
Showing
2 changed files
with
233 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,79 @@ | ||
name: Deploy production app to Firebase App Distribution | ||
on: | ||
pull_request: | ||
types: [ opened, synchronize, reopened, ready_for_review ] | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy_android: | ||
name: Deploy Android app to Firebase App Distribution | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
# deploy_android: | ||
# name: Deploy Android app to Firebase App Distribution | ||
# runs-on: ubuntu-latest | ||
# timeout-minutes: 30 | ||
# environment: production | ||
# defaults: | ||
# run: | ||
# working-directory: ./sample | ||
# steps: | ||
# - name: Set up JDK | ||
# uses: actions/setup-java@v2 | ||
# with: | ||
# distribution: 'temurin' | ||
# java-version: '17' | ||
|
||
# - name: Checkout source code | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: Cache Gradle | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: | | ||
# ~/.gradle/caches/modules-* | ||
# ~/.gradle/caches/jars-* | ||
# ~/.gradle/caches/build-cache-* | ||
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-gradle- | ||
|
||
# - name: Decode singing properties | ||
# run: echo "${{ secrets.ANDROID_SIGNING_PROPERTIES }}" | base64 --decode > signing.properties | ||
|
||
# - name: Decode release keystore | ||
# run: echo "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" | base64 --decode > config/release.keystore | ||
|
||
# - name: Decode buildKonfig properties | ||
# run: echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" | base64 --decode > buildKonfig.properties | ||
|
||
# - name: Build production APK | ||
# run: ./gradlew assembleProductionRelease -PversionCode=$GITHUB_RUN_NUMBER | ||
|
||
# - name: Deploy production to Firebase | ||
# uses: wzieba/[email protected] | ||
# with: | ||
# appId: ${{ vars.ANDROID_FIREBASE_APP_ID }} | ||
# serviceCredentialsFileContent: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIAL_FILE_CONTENT }} | ||
# groups: nimble | ||
# file: sample/android/build/outputs/apk/production/release/android-production-release.apk | ||
|
||
deploy_ios_production: | ||
runs-on: macos-latest | ||
environment: production | ||
defaults: | ||
run: | ||
working-directory: ./sample | ||
working-directory: ./sample/ios | ||
steps: | ||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Checkout source code | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cache Gradle | ||
uses: actions/cache@v3 | ||
uses: actions/cache@v3.3.2 | ||
with: | ||
path: | | ||
~/.gradle/caches/modules-* | ||
|
@@ -34,22 +83,72 @@ jobs: | |
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Decode singing properties | ||
run: echo "${{ secrets.ANDROID_SIGNING_PROPERTIES }}" | base64 --decode > signing.properties | ||
- name: Install SSH key - For accessing match repo | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
|
||
- uses: actions/cache@v3 | ||
id: bunlderCache | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Bundle install | ||
run: bundle install --path vendor/bundle | ||
|
||
- name: Cache Pods | ||
uses: actions/cache@v2 | ||
id: cocoapodCache | ||
with: | ||
path: Pods | ||
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-pods- | ||
- name: Decode release keystore | ||
run: echo "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" | base64 --decode > config/release.keystore | ||
- name: Install Pods Dependencies | ||
run: bundle exec pod install | ||
shell: bash | ||
|
||
- name: Decode buildKonfig properties | ||
run: echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" | base64 --decode > buildKonfig.properties | ||
run: | | ||
cd .. | ||
echo ${{ secrets.BUILD_KONFIG_PROPERTIES }} | base64 --decode > buildKonfig.properties | ||
- name: Build production APK | ||
run: ./gradlew assembleProductionRelease -PversionCode=$GITHUB_RUN_NUMBER | ||
- name: Paste Google-Info.plist from .secrets | ||
run: | | ||
mkdir -p sample/Configurations/Plists/GoogleService/Staging | ||
echo ${{ secrets.IOS_GOOGLE_INFO_PLIST }} | base64 --decode > ./sample/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist | ||
- name: Deploy production to Firebase | ||
uses: wzieba/[email protected] | ||
with: | ||
appId: ${{ vars.ANDROID_FIREBASE_APP_ID }} | ||
serviceCredentialsFileContent: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIAL_FILE_CONTENT }} | ||
groups: nimble | ||
file: sample/android/build/outputs/apk/production/release/android-production-release.apk | ||
- name: Paste Constants for Fastlane from .secrets | ||
run: | | ||
mkdir -p fastlane/Constants | ||
echo ${{ secrets.IOS_FASTLANE_CONSTANTS }} | base64 --decode > ./fastlane/Constants/Constant.swift | ||
- name: Generate KMM frameworks for Cocoapods | ||
run: | | ||
cd .. | ||
./gradlew generateDummyFramework | ||
- name: Build and Test | ||
run: bundle exec fastlane buildAndTest | ||
|
||
- name: Match AppStore | ||
run: bundle exec fastlane syncAppStoreCodeSigning | ||
env: | ||
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} | ||
|
||
- name: Build App and Distribute to AppStore | ||
run: bundle exec fastlane buildAndUploadToAppStore | ||
env: | ||
APPSTORE_CONNECT_API_KEY: ${{ secrets.APPSTORE_CONNECT_API_KEY }} | ||
API_KEY_ID: ${{ secrets.API_KEY_ID }} | ||
ISSUER_ID: ${{ secrets.ISSUER_ID }} | ||
BUMP_APP_STORE_BUILD_NUMBER: "true" | ||
|
||
- name: Remove Keychain | ||
if: ${{ always() }} | ||
run: bundle exec fastlane run delete_keychain | ||
continue-on-error: true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,73 @@ | ||
name: Deploy staging app to Firebase App Distribution | ||
on: | ||
pull_request: | ||
types: [ opened, synchronize, reopened, ready_for_review ] | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
deploy_android: | ||
name: Deploy Android app to Firebase App Distribution | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
# deploy_android: | ||
# name: Deploy Android app to Firebase App Distribution | ||
# runs-on: ubuntu-latest | ||
# timeout-minutes: 30 | ||
# environment: staging | ||
# defaults: | ||
# run: | ||
# working-directory: ./sample | ||
# steps: | ||
# - name: Set up JDK | ||
# uses: actions/setup-java@v2 | ||
# with: | ||
# distribution: 'temurin' | ||
# java-version: '17' | ||
|
||
# - name: Checkout source code | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: Cache Gradle | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: | | ||
# ~/.gradle/caches/modules-* | ||
# ~/.gradle/caches/jars-* | ||
# ~/.gradle/caches/build-cache-* | ||
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-gradle- | ||
|
||
# - name: Decode buildKonfig properties | ||
# run: echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" | base64 --decode > buildKonfig.properties | ||
|
||
# - name: Build staging APK | ||
# run: ./gradlew assembleStagingDebug -PversionCode=$GITHUB_RUN_NUMBER | ||
|
||
# - name: Deploy staging to Firebase | ||
# uses: wzieba/[email protected] | ||
# with: | ||
# appId: ${{ vars.ANDROID_FIREBASE_APP_ID }} | ||
# serviceCredentialsFileContent: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIAL_FILE_CONTENT }} | ||
# groups: nimble | ||
# file: sample/android/build/outputs/apk/staging/debug/android-staging-debug.apk | ||
|
||
deploy_ios_staging: | ||
runs-on: macos-latest | ||
environment: staging | ||
defaults: | ||
run: | ||
working-directory: ./sample | ||
working-directory: ./sample/ios | ||
steps: | ||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Checkout source code | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cache Gradle | ||
uses: actions/cache@v3 | ||
uses: actions/cache@v3.3.2 | ||
with: | ||
path: | | ||
~/.gradle/caches/modules-* | ||
|
@@ -34,16 +77,69 @@ jobs: | |
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Decode buildKonfig properties | ||
run: echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" | base64 --decode > buildKonfig.properties | ||
- name: Install SSH key - For accessing match repo | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
|
||
- uses: actions/cache@v3 | ||
id: bunlderCache | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Build staging APK | ||
run: ./gradlew assembleStagingDebug -PversionCode=$GITHUB_RUN_NUMBER | ||
- name: Bundle install | ||
run: bundle install --path vendor/bundle | ||
|
||
- name: Deploy staging to Firebase | ||
uses: wzieba/[email protected] | ||
- name: Cache Pods | ||
uses: actions/cache@v2 | ||
id: cocoapodCache | ||
with: | ||
appId: ${{ vars.ANDROID_FIREBASE_APP_ID }} | ||
serviceCredentialsFileContent: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIAL_FILE_CONTENT }} | ||
groups: nimble | ||
file: sample/android/build/outputs/apk/staging/debug/android-staging-debug.apk | ||
path: Pods | ||
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-pods- | ||
- name: Install Pods Dependencies | ||
run: bundle exec pod install | ||
shell: bash | ||
|
||
- name: Decode buildKonfig properties | ||
run: | | ||
cd .. | ||
echo ${{ secrets.BUILD_KONFIG_PROPERTIES }} | base64 --decode > buildKonfig.properties | ||
- name: Paste Google-Info.plist from .secrets | ||
run: | | ||
mkdir -p sample/Configurations/Plists/GoogleService/Staging | ||
echo ${{ secrets.IOS_GOOGLE_INFO_PLIST }} | base64 --decode > ./sample/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist | ||
- name: Paste Constants for Fastlane from .secrets | ||
run: | | ||
mkdir -p fastlane/Constants | ||
echo ${{ secrets.IOS_FASTLANE_CONSTANTS }} | base64 --decode > ./fastlane/Constants/Constant.swift | ||
- name: Generate KMM frameworks for Cocoapods | ||
run: | | ||
cd .. | ||
./gradlew generateDummyFramework | ||
- name: Build and Test | ||
run: bundle exec fastlane buildAndTest | ||
|
||
- name: Match Ad-hoc | ||
run: bundle exec fastlane syncAdHocStagingCodeSigning | ||
env: | ||
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} | ||
|
||
- name: Build App and Distribute to Firebase | ||
run: bundle exec fastlane buildStagingAndUploadToFirebase | ||
env: | ||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | ||
|
||
- name: Remove Keychain | ||
if: ${{ always() }} | ||
run: bundle exec fastlane run delete_keychain | ||
continue-on-error: true |