Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release - 0.3.0 #51

Merged
merged 29 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
565f9b1
[#30] Switch the android submodule to develop-koin branch
luongvo Oct 31, 2023
4d1848f
[#30] Fix: generate the Android app module with the entered bundle id
luongvo Oct 31, 2023
3c0ea52
[Chore] Generate & update sample project
bot-nimble Nov 1, 2023
6991848
[#30] Create a script to generate shared module
luongvo Nov 1, 2023
35ab48e
[#30] Rename package & app name in the shared module
luongvo Nov 1, 2023
16a34a6
[Chore] Generate & update sample project
bot-nimble Nov 1, 2023
e23321e
[#30] Move make_android and make_ios scripts to scripts folder
luongvo Nov 1, 2023
80720b8
[#30] Customize output folder to project name
luongvo Nov 1, 2023
781f00d
[Chore] Generate & update sample project
bot-nimble Nov 2, 2023
ea8c6e1
[Chore] Generate & update sample project
bot-nimble Nov 2, 2023
3beea1e
[#30] Keep buildKonfig.properties and ignore CONTRIBUTING.md
luongvo Nov 7, 2023
db275ca
[Chore] Generate & update sample project
bot-nimble Nov 8, 2023
71cbe98
Merge pull request #47 from nimblehq/feature/30-complete-the-script-t…
phongvhd93 Nov 14, 2023
44b9129
[#6] Add CD workflow
lydiasama Nov 30, 2023
4f6019b
[#6] Resolve PR comments
lydiasama Nov 30, 2023
db5cd5e
[#6] Update proguard rules
lydiasama Nov 30, 2023
102b1f1
[Chore] Generate & update sample project
bot-nimble Nov 30, 2023
e09524d
[#6] Fix: rename sample app package back to "co.nimblehq.kmm.template…
luongvo Nov 30, 2023
a8e761b
[#6] Fix: update BUILD_KONFIG_PROPERTIES fetching for test.yml workflow
luongvo Nov 30, 2023
8bc5ac7
[Chore] Generate & update sample project
bot-nimble Nov 30, 2023
9651dc9
[#6] Fix: the right usage of "branches-ignore" on pull request event
luongvo Nov 30, 2023
7c42b39
[Chore] Generate & update sample project
bot-nimble Nov 30, 2023
1304814
[Chore] Ignore release keystore file out of git
luongvo Nov 30, 2023
3309052
[Chore] Generate & update sample project
bot-nimble Nov 30, 2023
9f3c513
Merge pull request #48 from nimblehq/feature/6-set-up-cd-android
luongvo Dec 1, 2023
9ef0dce
Merge branch 'main' into chore/sync-main-and-release-0.3.0
phongvhd93 Dec 4, 2023
1bd97cf
[Chore] Generate & update sample project
bot-nimble Dec 4, 2023
052b610
Merge pull request #50 from nimblehq/chore/sync-main-and-release-0.3.0
phongvhd93 Dec 5, 2023
b0752a1
[Chore] Generate & update sample project
bot-nimble Dec 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading