Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaozhan committed Aug 19, 2024
2 parents 4eb55db + e984f6b commit b952d94
Show file tree
Hide file tree
Showing 108 changed files with 941 additions and 879 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Build

on:
schedule:
- cron: '0 0 * * 0' # Runs every Sunday at midnight UTC
workflow_dispatch: # Allows manual trigger

env:
BASE_URL_BACKEND: ${{ secrets.BASE_URL_BACKEND }}
BASE_URL_API: ${{ secrets.BASE_URL_API }}
BASE_URL_API_PREMIUM: ${{ secrets.BASE_URL_API_PREMIUM }}
API_KEY_PREMIUM: ${{ secrets.API_KEY_PREMIUM }}
ANDROID_KEY_STORE_PATH: ${{ secrets.ANDROID_KEY_STORE_PATH }}
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
RELEASE_ADVERTISEMENT_ID_GOOGLE: ${{ secrets.RELEASE_ADVERTISEMENT_ID_GOOGLE }}
DEBUG_ADVERTISEMENT_ID_GOOGLE: ${{ secrets.DEBUG_ADVERTISEMENT_ID_GOOGLE }}
RELEASE_ADVERTISEMENT_ID_HUAWEI: ${{ secrets.RELEASE_ADVERTISEMENT_ID_HUAWEI }}
DEBUG_ADVERTISEMENT_ID_HUAWEI: ${{ secrets.DEBUG_ADVERTISEMENT_ID_HUAWEI }}
GOOGLE_BANNER_AD_UNIT_ID_CALCULATOR_RELEASE: ${{ secrets.GOOGLE_BANNER_AD_UNIT_ID_CALCULATOR_RELEASE }}
GOOGLE_BANNER_AD_UNIT_ID_SETTINGS_RELEASE: ${{ secrets.GOOGLE_BANNER_AD_UNIT_ID_SETTINGS_RELEASE }}
GOOGLE_BANNER_AD_UNIT_ID_CURRENCIES_RELEASE: ${{ secrets.GOOGLE_BANNER_AD_UNIT_ID_CURRENCIES_RELEASE }}
GOOGLE_INTERSTITIAL_AD_ID_RELEASE: ${{ secrets.GOOGLE_INTERSTITIAL_AD_ID_RELEASE }}
GOOGLE_REWARDED_AD_UNIT_ID_RELEASE: ${{ secrets.GOOGLE_REWARDED_AD_UNIT_ID_RELEASE }}
GOOGLE_BANNER_AD_UNIT_ID_CALCULATOR_DEBUG: ${{ secrets.GOOGLE_BANNER_AD_UNIT_ID_CALCULATOR_DEBUG }}
GOOGLE_BANNER_AD_UNIT_ID_SETTINGS_DEBUG: ${{ secrets.GOOGLE_BANNER_AD_UNIT_ID_SETTINGS_DEBUG }}
GOOGLE_BANNER_AD_UNIT_ID_CURRENCIES_DEBUG: ${{ secrets.GOOGLE_BANNER_AD_UNIT_ID_CURRENCIES_DEBUG }}
GOOGLE_INTERSTITIAL_AD_ID_DEBUG: ${{ secrets.GOOGLE_INTERSTITIAL_AD_ID_DEBUG }}
GOOGLE_REWARDED_AD_UNIT_ID_DEBUG: ${{ secrets.GOOGLE_REWARDED_AD_UNIT_ID_DEBUG }}
HUAWEI_BANNER_AD_UNIT_ID_CALCULATOR_RELEASE: ${{ secrets.HUAWEI_BANNER_AD_UNIT_ID_CALCULATOR_RELEASE }}
HUAWEI_BANNER_AD_UNIT_ID_SETTINGS_RELEASE: ${{ secrets.HUAWEI_BANNER_AD_UNIT_ID_SETTINGS_RELEASE }}
HUAWEI_BANNER_AD_UNIT_ID_CURRENCIES_RELEASE: ${{ secrets.HUAWEI_BANNER_AD_UNIT_ID_CURRENCIES_RELEASE }}
HUAWEI_INTERSTITIAL_AD_ID_RELEASE: ${{ secrets.HUAWEI_INTERSTITIAL_AD_ID_RELEASE }}
HUAWEI_REWARDED_AD_UNIT_ID_RELEASE: ${{ secrets.HUAWEI_REWARDED_AD_UNIT_ID_RELEASE }}
HUAWEI_BANNER_AD_UNIT_ID_CALCULATOR_DEBUG: ${{ secrets.HUAWEI_BANNER_AD_UNIT_ID_CALCULATOR_DEBUG }}
HUAWEI_BANNER_AD_UNIT_ID_SETTINGS_DEBUG: ${{ secrets.HUAWEI_BANNER_AD_UNIT_ID_SETTINGS_DEBUG }}
HUAWEI_BANNER_AD_UNIT_ID_CURRENCIES_DEBUG: ${{ secrets.HUAWEI_BANNER_AD_UNIT_ID_CURRENCIES_DEBUG }}
HUAWEI_INTERSTITIAL_AD_ID_DEBUG: ${{ secrets.HUAWEI_INTERSTITIAL_AD_ID_DEBUG }}
HUAWEI_REWARDED_AD_UNIT_ID_DEBUG: ${{ secrets.HUAWEI_REWARDED_AD_UNIT_ID_DEBUG }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_KEY_CONTENT }}
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
IOS_RELEASE_FIREBASE_APP_ID: ${{ secrets.IOS_RELEASE_FIREBASE_APP_ID }}
IOS_DEBUG_FIREBASE_APP_ID: ${{ secrets.IOS_DEBUG_FIREBASE_APP_ID }}
FIREBASE_CLI_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
GIT_AUTHORIZATION: ${{ secrets.GIT_AUTHORIZATION }}
SECRET_PASSWORD: ${{ secrets.SECRET_PASSWORD }}
MATCH_PASSWORD: ${{ secrets.SECRET_PASSWORD }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 5
FASTLANE_XCODEBUILD_SETTINGS_RETRIES: 5
CI: true

jobs:

Build:
runs-on: macos-14
outputs:
status: ${{ steps.status.outputs.status }}
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e

- name: Adding secret files
uses: ./.github/actions/add-secret-files
with:
ANDROID_RELEASE_KEYSTORE_ASC: ${{ secrets.ANDROID_RELEASE_KEYSTORE_ASC }}
SECRET_PASSWORD: ${{ secrets.SECRET_PASSWORD }}
GOOGLE_SERVICES_JSON_ASC: ${{ secrets.GOOGLE_SERVICES_JSON_ASC }}
AG_CONNECT_SERVICES_JSON_ASC: ${{ secrets.AG_CONNECT_SERVICES_JSON_ASC }}
GOOGLE_SERVICE_INFO_PLIST_ASC_RELEASE: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST_ASC_RELEASE }}
GOOGLE_SERVICE_INFO_PLIST_ASC_DEBUG: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST_ASC_DEBUG }}
IOS_XCCONFIG_ASC_RELEASE: ${{ secrets.IOS_XCCONFIG_ASC_RELEASE }}
IOS_XCCONFIG_ASC_DEBUG: ${{ secrets.IOS_XCCONFIG_ASC_DEBUG }}
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}

- name: Build
run: ./gradlew build

- name: Set Job Status
id: status
run: echo "status=success" >> $GITHUB_OUTPUT

Notify:
runs-on: ubuntu-22.04
needs: [ Build ]
if: always()
steps:

- name: Notify slack fail
if: false == (needs.Build.outputs.status == 'success')
uses: voxmedia/[email protected]
with:
channel: ccc-github
status: FAILED
color: danger
119 changes: 56 additions & 63 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches:
- develop
pull_request:
schedule:
- cron: '0 0 * * *' # At 00:00 every day

concurrency:
group: ${{ github.ref == 'refs/heads/develop' && 'develop' || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
group: ${{ github.ref == 'refs/heads/develop' && 'develop' || github.ref }} # Only run one job at a time for the same branch
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }} # Only cancel the same branch but not develop

env:
BASE_URL_BACKEND: ${{ secrets.BASE_URL_BACKEND }}
Expand Down Expand Up @@ -46,7 +48,8 @@ env:
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_KEY_CONTENT }}
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
IOS_GOOGLE_FIREBASE_APP_ID: ${{ secrets.IOS_GOOGLE_FIREBASE_APP_ID }}
IOS_RELEASE_FIREBASE_APP_ID: ${{ secrets.IOS_RELEASE_FIREBASE_APP_ID }}
IOS_DEBUG_FIREBASE_APP_ID: ${{ secrets.IOS_DEBUG_FIREBASE_APP_ID }}
FIREBASE_CLI_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
GIT_AUTHORIZATION: ${{ secrets.GIT_AUTHORIZATION }}
SECRET_PASSWORD: ${{ secrets.SECRET_PASSWORD }}
Expand All @@ -55,6 +58,8 @@ env:
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 5
FASTLANE_XCODEBUILD_SETTINGS_RETRIES: 5
CI: true
BUILD_TYPE: ${{ github.event_name == 'schedule' && 'Release' || 'Debug' }}
BUILD_TYPE_LOWERCASE: ${{ github.event_name == 'schedule' && 'release' || 'debug' }}

jobs:

Expand All @@ -65,7 +70,7 @@ jobs:
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@d5c2d633506a792e53d7a273d90dde429df3bba7
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e

- name: Adding secret files
uses: ./.github/actions/add-secret-files
Expand All @@ -80,19 +85,17 @@ jobs:
IOS_XCCONFIG_ASC_DEBUG: ${{ secrets.IOS_XCCONFIG_ASC_DEBUG }}
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}

- name: Assemble
run: ./gradlew assemble
- name: Assemble ${{ env.BUILD_TYPE }}
run: ./gradlew assemble${{ env.BUILD_TYPE }}

- name: Upload Android Artifacts
uses: actions/[email protected].3
if: github.event_name == 'push'
- name: Upload Android ${{ env.BUILD_TYPE }} Artifacts
uses: actions/[email protected].6
if: github.event_name == 'push' || github.event_name == 'schedule'
with:
name: androidArtifacts
path: |
android/app/build/outputs/apk/google/debug/app-google-debug.apk
android/app/build/outputs/apk/huawei/debug/app-huawei-debug.apk
android/app/build/outputs/apk/google/release/app-google-release.apk
android/app/build/outputs/apk/huawei/release/app-huawei-release.apk
android/app/build/outputs/apk/google/${{ env.BUILD_TYPE_LOWERCASE }}/app-google-${{ env.BUILD_TYPE_LOWERCASE }}.apk
android/app/build/outputs/apk/huawei/${{ env.BUILD_TYPE_LOWERCASE }}/app-huawei-${{ env.BUILD_TYPE_LOWERCASE }}.apk
- name: Cancel other jobs if this fails
if: failure()
Expand All @@ -105,52 +108,36 @@ jobs:
DistributeAndroid:
runs-on: ubuntu-22.04
needs: [ GradleBuild ]
if: github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'schedule'
outputs:
status: ${{ steps.status.outputs.status }}
steps:

- name: Clone Repo # Needed for reading commit message for Firebase App Distribution
uses: actions/[email protected]

- name: Download Android Artifacts
uses: actions/[email protected].7
- name: Download Android ${{ env.BUILD_TYPE }} Artifacts
uses: actions/[email protected].8
with:
name: androidArtifacts

- name: Firebase App Distribution Google Debug
uses: wzieba/[email protected]
with:
appId: ${{secrets.ANDROID_GOOGLE_DEBUG_FIREBASE_APP_ID}}
token: ${{secrets.FIREBASE_CLI_TOKEN}}
groups: QA
file: google/debug/app-google-debug.apk

- name: Firebase App Distribution Google Release
uses: wzieba/[email protected]
with:
appId: ${{secrets.ANDROID_GOOGLE_RELEASE_FIREBASE_APP_ID}}
token: ${{secrets.FIREBASE_CLI_TOKEN}}
groups: QA
file: google/release/app-google-release.apk

- name: Firebase App Distribution Huawei Debug
- name: Firebase App Distribution Google ${{ env.BUILD_TYPE }}
uses: wzieba/[email protected]
with:
appId: ${{secrets.ANDROID_HUAWEI_DEBUG_FIREBASE_APP_ID}}
appId: ${{ github.event_name == 'schedule' && secrets.ANDROID_GOOGLE_RELEASE_FIREBASE_APP_ID || secrets.ANDROID_GOOGLE_DEBUG_FIREBASE_APP_ID }}
token: ${{secrets.FIREBASE_CLI_TOKEN}}
groups: QA
file: huawei/debug/app-huawei-debug.apk
file: google/${{ env.BUILD_TYPE_LOWERCASE }}/app-google-${{ env.BUILD_TYPE_LOWERCASE }}.apk

- name: Firebase App Distribution Huawei Release
- name: Firebase App Distribution Huawei ${{ env.BUILD_TYPE }}
uses: wzieba/[email protected]
with:
appId: ${{secrets.ANDROID_HUAWEI_RELEASE_FIREBASE_APP_ID}}
appId: ${{ github.event_name == 'schedule' && secrets.ANDROID_HUAWEI_RELEASE_FIREBASE_APP_ID || secrets.ANDROID_HUAWEI_DEBUG_FIREBASE_APP_ID }}
token: ${{secrets.FIREBASE_CLI_TOKEN}}
groups: QA
file: huawei/release/app-huawei-release.apk
file: huawei/${{ env.BUILD_TYPE_LOWERCASE }}/app-huawei-${{ env.BUILD_TYPE_LOWERCASE }}.apk

- name: Delete Android Artifacts
- name: Delete Android ${{ env.BUILD_TYPE }} Artifacts
uses: geekyeggo/[email protected]
with:
name: androidArtifacts
Expand All @@ -166,7 +153,7 @@ jobs:
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@d5c2d633506a792e53d7a273d90dde429df3bba7
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e

- name: Adding secret files
uses: ./.github/actions/add-secret-files
Expand All @@ -181,13 +168,20 @@ jobs:
IOS_XCCONFIG_ASC_DEBUG: ${{ secrets.IOS_XCCONFIG_ASC_DEBUG }}
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}

- name: Build
- name: Build ${{ env.BUILD_TYPE }}
working-directory: ios
run: fastlane build
run: fastlane build${{ env.BUILD_TYPE }}

- name: Upload iOS Artifacts
uses: actions/[email protected].3
- name: Upload iOS Debug Artifacts
uses: actions/[email protected].6
if: github.event_name == 'push'
with:
name: iOSArtifacts
path: ios/CCC_I.ipa

- name: Upload iOS Artifacts
uses: actions/[email protected]
if: github.event_name == 'schedule'
with:
name: iOSArtifacts
path: |
Expand All @@ -205,27 +199,27 @@ jobs:
DistributeIOS:
runs-on: ubuntu-22.04
needs: [ XCodeBuild ]
if: github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'schedule'
outputs:
status: ${{ steps.status.outputs.status }}
steps:
- name: Clone Repo
uses: actions/[email protected]

- name: Download iOS IPA
uses: actions/[email protected].7
- name: Download iOS ${{ env.BUILD_TYPE }} Artifacts
uses: actions/[email protected].8
with:
name: iOSArtifacts
path: ios

# was necessary to use chown to fix permission issues in linux machines
- name: Distribute
- name: Distribute ${{ env.BUILD_TYPE }}
working-directory: ios
run: |
sudo chown -R $(whoami) /var/lib/gems/3.0.0
fastlane distribute
fastlane distribute${{ env.BUILD_TYPE }}
- name: Delete iOS IPA
- name: Delete iOS ${{ env.BUILD_TYPE }} Artifacts
uses: geekyeggo/[email protected]
with:
name: iOSArtifacts
Expand All @@ -234,18 +228,17 @@ jobs:
id: status
run: echo "status=success" >> $GITHUB_OUTPUT

Check:
Test:
runs-on: macos-14
if: github.ref != 'refs/heads/develop'
outputs:
status: ${{ steps.status.outputs.status }}
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@d5c2d633506a792e53d7a273d90dde429df3bba7
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e

- name: Run Check
run: ./gradlew check
- name: Test
run: ./gradlew test

- name: Cancel other jobs if this fails
if: failure()
Expand All @@ -262,7 +255,7 @@ jobs:
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@d5c2d633506a792e53d7a273d90dde429df3bba7
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e

- name: Generate Coverage
run: ./gradlew koverXmlReport
Expand Down Expand Up @@ -305,10 +298,10 @@ jobs:
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@d5c2d633506a792e53d7a273d90dde429df3bba7
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e

- name: Detekt
run: ./gradlew detektAll
- name: Detekt & Lint
run: ./gradlew detektAll lint

- name: SwiftLint
uses: norio-nomura/[email protected]
Expand All @@ -327,18 +320,18 @@ jobs:

Notify:
runs-on: ubuntu-22.04
needs: [ GradleBuild, XCodeBuild, Check, Coverage, CodeAnalysis, DistributeAndroid, DistributeIOS ]
needs: [ GradleBuild, XCodeBuild, Test, Coverage, CodeAnalysis, DistributeAndroid, DistributeIOS ]
if: always()
steps:

- name: Notify slack fail
if: false == (needs.GradleBuild.outputs.status == 'success') ||
false == (needs.XCodeBuild.outputs.status == 'success') ||
(false == (needs.Check.outputs.status == 'success') && github.ref != 'refs/heads/develop')||
false == (needs.Test.outputs.status == 'success') ||
false == (needs.Coverage.outputs.status == 'success') ||
false == (needs.CodeAnalysis.outputs.status == 'success') ||
(false == (needs.DistributeAndroid.outputs.status == 'success') && github.event_name == 'push') ||
(false == (needs.DistributeIOS.outputs.status == 'success') && github.event_name == 'push')
(false == (needs.DistributeAndroid.outputs.status == 'success') && (github.event_name == 'push' || github.event_name == 'schedule')) ||
(false == (needs.DistributeIOS.outputs.status == 'success') && (github.event_name == 'push' || github.event_name == 'schedule'))
uses: voxmedia/[email protected]
with:
channel: ccc-github
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
ProjectAutomations:
uses: Oztechan/Global/.github/workflows/reusable-project.yml@d5c2d633506a792e53d7a273d90dde429df3bba7
uses: Oztechan/Global/.github/workflows/reusable-project.yml@007659c3464bb29eeaaed0abfd2822af806dfe1e
with:
project_id: 2
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:

PublishRelease:
uses: Oztechan/Global/.github/workflows/reusable-publish.yml@d5c2d633506a792e53d7a273d90dde429df3bba7
uses: Oztechan/Global/.github/workflows/reusable-publish.yml@007659c3464bb29eeaaed0abfd2822af806dfe1e
with:
slack_channel: "ccc-github"
secrets: inherit
Loading

0 comments on commit b952d94

Please sign in to comment.