Skip to content

Commit

Permalink
Merge pull request #51 from nimblehq/release/0.3.0
Browse files Browse the repository at this point in the history
Release - 0.3.0
  • Loading branch information
phongvhd93 authored Dec 5, 2023
2 parents 23aef55 + b0752a1 commit 828f5d6
Show file tree
Hide file tree
Showing 25 changed files with 685 additions and 251 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy production app to Firebase App Distribution
on:
push:
branches:
- main

jobs:
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: Set up the necessary config
run: |
echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" > buildKonfig.properties
echo "${{ secrets.ANDROID_SIGNING_PROPERTIES }}" > signing.properties
echo "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" | base64 --decode > config/release.keystore
- 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
49 changes: 49 additions & 0 deletions .github/workflows/deploy_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy staging app to Firebase App Distribution
on:
push:
branches:
- develop

jobs:
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: Set up the necessary config
run: echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" > 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
15 changes: 10 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Code analysis, test and generate sample project
on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
types: [ opened, edited, reopened, synchronize ]
push:
branches-ignore:
- main
- develop
- 'release/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -100,8 +105,8 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Decode buildKonfig properties
run: echo ${{ secrets.BUILD_KONFIG_PROPERTIES }} | base64 --decode > buildKonfig.properties
- name: Set up the necessary config
run: echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" > buildKonfig.properties

- name: Run Detekt
run: ./gradlew detekt
Expand Down Expand Up @@ -165,9 +170,9 @@ jobs:
restore-keys: |
${{ runner.os }}-pods-
- name: Decode buildKonfig properties
- name: Set up the necessary config
working-directory: ./sample
run: echo ${{ secrets.BUILD_KONFIG_PROPERTIES }} | base64 --decode > buildKonfig.properties
run: echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" > buildKonfig.properties

- name: Generate KMM frameworks for Cocoapods
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ local.properties
xcuserdata
buildKonfig.properties

# Keystore
config/release.keystore

# iOS
ios/Pods/
ios/fastlane/README.md
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
[submodule "android"]
path = android
url = [email protected]:nimblehq/android-templates.git
branch = feature/replace-hilt-with-koin
branch = develop-koin
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ TODO
### Prerequisites

- [JDK](https://www.oracle.com/java/technologies/javase-downloads.html): Java 17
- [Kscript](https://github.com/holgerbrandl/kscript) v4.0.3 or later.
- [Android Studio](https://developer.android.com/studio) with [Kotlin Multiplatform Mobile plugin](https://kotlinlang.org/docs/multiplatform-mobile-plugin-releases.html)
- [Xcode](https://apps.apple.com/us/app/xcode/id497799835) 13.3+

Expand All @@ -28,13 +29,17 @@ Follow these steps to set up a new project from the template:

3. Generate the new project by running the following command:

`$ ./make.sh --bundle-id [BUNDLE_ID] --bundle-id-staging [BUNDLE_ID_STAGING] --project-name [PROJECT_NAME] --ios-version [IOS_VERSION]`

For example,

`$ ./make.sh --bundle-id co.nimblehq.kmm.template --bundle-id-staging co.nimblehq.kmm.template.staging --project-name sample --ios-version 14.0`

To skip CI/CD service generating from iOS script, export this CI env:

`$ export CI=true`

The generated project is in the `/sample` folder and ready to build, run, and test 🎉
The generated project is in the `[PROJECT_NAME]` folder (such as `/sample`) and ready to build, run, and test 🎉

## Contributing

Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions custom/android/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@
#-keepnames class <1>$$serializer { # -keepnames suffices; class is kept when serializer() is kept.
# static <1>$$serializer INSTANCE;
#}

# Suppress: Missing class org.slf4j.impl.StaticLoggerBinder while running R8
-dontwarn org.slf4j.impl.StaticLoggerBinder
21 changes: 13 additions & 8 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,26 @@ git reset --hard
cd ..

# Generate iOS module
sh make_ios.sh -b ${bundle_id_production} -s ${bundle_id_staging} -n ${project_name} -iv ${minimum_ios_version}
sh scripts/make_ios.sh -b ${bundle_id_production} -s ${bundle_id_staging} -n ${project_name} -iv ${minimum_ios_version}

# Generate Android module
sh make_android.sh -b ${bundle_id_production} -n ${project_name}
sh scripts/make_android.sh -b ${bundle_id_production} -n ${project_name}

# Clone all project files to the "sample" directory
echo "=> Clone all project files to the "sample" directory"
# Clone all project files to the $project_name directory
echo "=> Clone all project files to the '$project_name' directory"
rsync -av \
--exclude '.git' \
--exclude '.gitmodules' \
--exclude 'make.sh' \
--exclude 'make_android.sh' \
--exclude 'make_ios.sh' \
--exclude 'CONTRIBUTING.md' \
--exclude '/scripts' \
--exclude '/custom' \
--exclude '/android' \
--exclude '/shared' \
--exclude '/sample' \
./ sample/
rsync -av ./android/sample/app/ sample/android/
--exclude '/'$project_name \
./ $project_name/
rsync -av ./android/$project_name/app/ $project_name/android/

# Generate Shared module
kscript scripts/make_shared.kts package-name=${bundle_id_production} app-name=${project_name}
52 changes: 52 additions & 0 deletions sample/.github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy production app to Firebase App Distribution
on:
push:
branches:
- main

jobs:
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: Set up the necessary config
run: |
echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" > buildKonfig.properties
echo "${{ secrets.ANDROID_SIGNING_PROPERTIES }}" > signing.properties
echo "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" | base64 --decode > config/release.keystore
- 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
49 changes: 49 additions & 0 deletions sample/.github/workflows/deploy_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy staging app to Firebase App Distribution
on:
push:
branches:
- develop

jobs:
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: Set up the necessary config
run: echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" > 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
15 changes: 10 additions & 5 deletions sample/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Code analysis, test and generate sample project
on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
types: [ opened, edited, reopened, synchronize ]
push:
branches-ignore:
- main
- develop
- 'release/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -100,8 +105,8 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Decode buildKonfig properties
run: echo ${{ secrets.BUILD_KONFIG_PROPERTIES }} | base64 --decode > buildKonfig.properties
- name: Set up the necessary config
run: echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" > buildKonfig.properties

- name: Run Detekt
run: ./gradlew detekt
Expand Down Expand Up @@ -165,9 +170,9 @@ jobs:
restore-keys: |
${{ runner.os }}-pods-
- name: Decode buildKonfig properties
- name: Set up the necessary config
working-directory: ./sample
run: echo ${{ secrets.BUILD_KONFIG_PROPERTIES }} | base64 --decode > buildKonfig.properties
run: echo "${{ secrets.BUILD_KONFIG_PROPERTIES }}" > buildKonfig.properties

- name: Generate KMM frameworks for Cocoapods
run: |
Expand Down
3 changes: 3 additions & 0 deletions sample/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ local.properties
xcuserdata
buildKonfig.properties

# Keystore
config/release.keystore

# iOS
ios/Pods/
ios/fastlane/README.md
Expand Down
Loading

0 comments on commit 828f5d6

Please sign in to comment.