diff --git a/.github/wiki/Bitrise.md b/.github/wiki/Bitrise.md index fda498a6..878c9e21 100644 --- a/.github/wiki/Bitrise.md +++ b/.github/wiki/Bitrise.md @@ -11,7 +11,7 @@ Out of the box, the Bitrise Template has the following workflows and steps: | Bitrise.io Cache:Pull | Bitrise.io Cache:Pull | Bitrise.io Cache:Pull | Bitrise.io Cache:Pull | | Run CocoaPods install | Run CocoaPods install | Run CocoaPods install | Run CocoaPods install | | Fastlane - Build and Test | Xcode Test for iOS | Xcode Test for iOS | Xcode Test for iOS | -| Fastlane - Run XCov | Fastlane Match | Fastlane Match | Fastlane Match | +| Fastlane - Clean Up Xcov | Fastlane Match | Fastlane Match | Fastlane Match | | Danger | Fastlane - Build and Upload Production App to App Store | Fastlane - Build and Upload Staging App | Fastlane: Build and Upload Production App | ## Trigger Map @@ -21,7 +21,7 @@ Out of the box, the Bitrise Template has the following workflows and steps: | test | Create or Update a PR | | deploy_staging | Push branch `develop` | | deploy_release_firebase | Push branch `release/*` | -| deploy_app_store | Push branch `master` | +| deploy_app_store | Push branch `master`/`main` | ## Environment and Secrets ### App Environtment Variables @@ -40,6 +40,9 @@ All four workflows have their own variables: - BUNDLE_ID > e.g., com.nimblehq.exampleApp +- BITRISE_SCHEME +> Your build scheme in Xcode (e.g., ExampleApp UAT, ExampleApp Staging, or ExampleApp) + *Depending on which workflow, the value of those variables may differ from other workflows.* ### Secrets @@ -52,7 +55,7 @@ All four workflows have their own variables: 2. To connect your repository to Bitrise please follow the instruction in this page: [Adding a new app](https://devcenter.bitrise.io/en/getting-started/adding-your-first-app.html). 3. Make sure the option where the `bitrise.yml` locate is set to `Store in-app repository`.

- Bitrise Store in-app repository + Bitrise Store in-app repository

4. Provide all the required variables and secrets. diff --git a/.github/wiki/Fastlane.md b/.github/wiki/Fastlane.md new file mode 100644 index 00000000..ccaed67d --- /dev/null +++ b/.github/wiki/Fastlane.md @@ -0,0 +1,150 @@ +Fastlane is a part of the automation tool for the development and release process of the project. This document will mention some crucial parts of the pipeline. + + + +## Fastfile + +### Build and test + +The lane `build_and_test` helps build and test the application with the configuration of the test scheme and test target defined in the `Constants.rb` file. + +Example: + +``` +$ bundle exec fastlane build_and_test +``` + +After running this lane, it is able to generate the code coverage report. + +> See more: +> +> - [Constants.rb](#constantsrb) + +### Synchronize the provisioning profile + +As the developer team has many developers, it is recommended to synchronize the certificates and profiles across the team during the development process. + +The `fastlane match` is here for sharing one code signing identity across the development team to simplify the codesigning setup and prevent code signing issues. + +To synchronize the machine with the certificate and profiles which is stored in a match repository, please use the following lanes: + +| `sync_development_signing` | `sync_adhoc_signing` | `sync_adhoc_production_signing` | `sync_appstore_signing` | +|---|---|---|---| +| Synchronize with the development distribution. | Synchronize with the Ad Hoc distribution for the Staging build. | Synchronize with the Ad Hoc distribution for the Production build. | Synchronize with the App Store Connect distribution. | + + +Example: + +``` +$ bundle exec fastlane sync_development_signing +$ bundle exec fastlane sync_adhoc_signing +$ bundle exec fastlane sync_adhoc_production_signing +$ bundle exec fastlane sync_appstore_signing +``` + +### Register a new device + +To register a new device and synchronize the new device across the development team, use the lane `register_new_device` and provide the device UDID along with the device name: + +Example: + +``` +$ bundle exec fastlane register_new_device +``` + +### Build and upload the application + +So as to build and upload the application to distribution tools, like Firebase or App Store Connect, please use these lanes: + +| `build_and_upload_staging_app` | `build_and_upload_production_app` | `build_and_upload_appstore_app` | +|---|---|---| +| To upload the Staging build and Staging dSYM file to Firebase. | To upload the Production build and Production dSYM file to Firebase. | To upload the Production build to App Store and Testflight. | + +Example: + +``` +$ bundle exec fastlane build_and_upload_staging_app +$ bundle exec fastlane build_and_upload_production_app +$ bundle exec fastlane build_and_upload_appstore_app +``` + +> See more: +> +> - [Gymfile](#gymfile) +> - [BuildManager.rb](#buildmanagerrb) +> - [DistributionManager.rb](#distributionmanagerrb) + + +## Matchfile + +Define the basic information to synchronize the certificates and profiles across the development team. + +> See more: +> +> - [MatchManager.rb](#matchmanagerrb) +> - [Synchronize the provisioning profile](#synchronize-the-provisioning-profile) + +## Gymfile + +Store defaults parameters when triggering a new build. + +## Constants folder + +### Constants.rb + +Contains the key/value pairs of constants that will be used during the development and release process. + +### Environments.rb + +Contains the key/value pairs of environment variables that will be used during the development and release process. + +## Managers folder + +### BuildManager.rb + +The `BuildManager` helps build and sign the application. There are two main functions: + +| `build_ad_hoc` | `build_app_store` | +|---|---| +| Build and sign the application with the `ad-hoc` distribution. | Build and sign the application with the `app-store` distribution. | + +> See more: +> +> - [Build and upload the application](#build-and-upload-the-application) + +### DistributionManager.rb + +The `DistributionManager` is in charge of distributing the build to the distribution tools, such as Firebase, App Store Connect, and Testflight. + +> See more: +> +> - [Build and upload the application](#build-and-upload-the-application) + +### MatchManager.rb + +The responsibility of `MatchManager` is to synchronize the certificates and profiles across the team during the development process. + +> See more: +> +> - [Synchronize the provisioning profile](#synchronize-the-provisioning-profile) +> - [Matchfile](#matchfile) + +### SymbolManager.rb + +Technically, the debug Symbol file (dSYM file) is used to de-obfuscate stack traces from crashes happening on the production app. The dSYM files store the debug symbols for the application. Then services (like Crashlytics) use the dSYM files to replace the symbols in the crash reports with the originating locations in the source code. Hence, the crash reports will be more readable and understandable. + +The `SymbolManager` helps process and upload dSYM file to Firebase. There are two main functions: + +| `upload_built_symbol_to_firebase` | `download_processed_dsym_then_upload_to_firebase` | +|---|---| +| Directly upload the built dSYM file to Crashlytics. | Download the processed dSYM file from App Store Connect, then upload it to Crashlytics. | +| It is recommended to use this function when the build configuration is `Release Staging`. | It is recommended to use this function when the build configuration is `Release Production`. | +| See more: [Debug Symbol File](Project-Configurations.md#debug-symbol-file) | See more: [Debug Symbol File](Project-Configurations.md#debug-symbol-file) and [Enable Bitcode](Project-Configurations.md#enable-bitcode) | + +### TestManager.rb + +The `TestManager` helps build and test the application. + +### VersioningManager.rb + +The `VersioningManager` manages the build number and version number of the application. \ No newline at end of file diff --git a/.github/wiki/Project-Configurations.md b/.github/wiki/Project-Configurations.md index 2fefdf34..1b97ba6d 100644 --- a/.github/wiki/Project-Configurations.md +++ b/.github/wiki/Project-Configurations.md @@ -1,10 +1,10 @@ -## Project Configurations - This document presents in detail the set of configurations used in the iOS projects developed at Nimble. Included in this document are: - Terminologies and topics related to project configurations. - Basic targets, schemes, build settings options, etc., for building a project. +## Project Terminology + ### Targets A target specifies a product to build, such as an iOS, watchOS, or macOS app. @@ -42,6 +42,8 @@ The recommended set of configurations to have is: - Debug Production - Release Production +## Predefined Build Options + ### Active Compilation Conditions Having distinct flags for each configuration is the preferred solution. diff --git a/.github/wiki/Self-Hosted-Github-Actions.md b/.github/wiki/Self-Hosted-Github-Actions.md index 7622b65d..79f82019 100644 --- a/.github/wiki/Self-Hosted-Github-Actions.md +++ b/.github/wiki/Self-Hosted-Github-Actions.md @@ -29,7 +29,7 @@ To install all the dependencies, follow these required steps: 1. Download Xcode and Xcode Command Line Tool fromĀ [https://developer.apple.com/xcode/](https://developer.apple.com/xcode/) - ![Download Xcode](assets/images/self-hosted-github-actions/download-xcode.png) + ![Download Xcode](assets/images/operations/self-hosted-github-actions/download-xcode.png) 2. Launch `Terminal` to install Ruby with `gem update --system`. The current version used for writing this document is `gem install bundler:2.2.15`. 3. Connect Github Actions Runner to the machine. @@ -40,9 +40,9 @@ To install all the dependencies, follow these required steps: The instruction for connecting Github Actions to the hosting machine should follow the instruction found in `Settings > Actions > Runners > New self-hosted runner` in the projects repository page. -![New Self Hosted Runner](assets/images/self-hosted-github-actions/new-self-hosted-runner.png) +![New Self Hosted Runner](assets/images/operations/self-hosted-github-actions/new-self-hosted-runner.png) -![New Self Hosted Runner Script](assets/images/self-hosted-github-actions/new-self-hosted-runner-script.png) +![New Self Hosted Runner Script](assets/images/operations/self-hosted-github-actions/new-self-hosted-runner-script.png) The general steps are: @@ -61,4 +61,4 @@ In the case that the machine is shut down or the terminal running the script was When setting up successfully. -![Result](assets/images/self-hosted-github-actions/result.png) +![Result](assets/images/operations/self-hosted-github-actions/result.png) diff --git a/.github/wiki/_Sidebar.md b/.github/wiki/_Sidebar.md index ee30afcf..f91857c9 100644 --- a/.github/wiki/_Sidebar.md +++ b/.github/wiki/_Sidebar.md @@ -1,11 +1,21 @@ -* [[Home]] -* [[Getting Started]] -* [[Automating Wiki]] - -**Technical document** -* [[Standard File Organization]] -* [[Project Configurations]] -* [[Project Dependencies]] -* [[Github Actions]] -* [[Self Hosted Github Actions]] -* [[Bitrise]] +## Table of contents + +- [[Home]] +- [[Getting Started]] + +## Architecture + +- [[Standard File Organization]] +- [[Project Configurations]] +- [[Project Dependencies]] + +## Infrastructure + +- [[Github Actions]] +- [[Self Hosted Github Actions]] +- [[Bitrise]] +- [[Fastlane]] + +## Operations + +- [[Automating Wiki]] diff --git a/.github/wiki/assets/images/infrastructure/fastlane/fastlane.png b/.github/wiki/assets/images/infrastructure/fastlane/fastlane.png new file mode 100644 index 00000000..1b89e58b Binary files /dev/null and b/.github/wiki/assets/images/infrastructure/fastlane/fastlane.png differ diff --git a/.github/wiki/assets/images/bitrise/Bitrise-YML-Storage-Location.png b/.github/wiki/assets/images/operations/bitrise/bitrise-yml-storage-location.png similarity index 100% rename from .github/wiki/assets/images/bitrise/Bitrise-YML-Storage-Location.png rename to .github/wiki/assets/images/operations/bitrise/bitrise-yml-storage-location.png diff --git a/.github/wiki/assets/images/self-hosted-github-actions/download-xcode.png b/.github/wiki/assets/images/operations/self-hosted-github-actions/download-xcode.png similarity index 100% rename from .github/wiki/assets/images/self-hosted-github-actions/download-xcode.png rename to .github/wiki/assets/images/operations/self-hosted-github-actions/download-xcode.png diff --git a/.github/wiki/assets/images/self-hosted-github-actions/new-self-hosted-runner-script.png b/.github/wiki/assets/images/operations/self-hosted-github-actions/new-self-hosted-runner-script.png similarity index 100% rename from .github/wiki/assets/images/self-hosted-github-actions/new-self-hosted-runner-script.png rename to .github/wiki/assets/images/operations/self-hosted-github-actions/new-self-hosted-runner-script.png diff --git a/.github/wiki/assets/images/self-hosted-github-actions/new-self-hosted-runner.png b/.github/wiki/assets/images/operations/self-hosted-github-actions/new-self-hosted-runner.png similarity index 100% rename from .github/wiki/assets/images/self-hosted-github-actions/new-self-hosted-runner.png rename to .github/wiki/assets/images/operations/self-hosted-github-actions/new-self-hosted-runner.png diff --git a/.github/wiki/assets/images/self-hosted-github-actions/result.png b/.github/wiki/assets/images/operations/self-hosted-github-actions/result.png similarity index 100% rename from .github/wiki/assets/images/self-hosted-github-actions/result.png rename to .github/wiki/assets/images/operations/self-hosted-github-actions/result.png diff --git a/.github/workflows/publish_docs_to_wiki.yml b/.github/workflows/publish_docs_to_wiki.yml index fe3ff6fe..a8cadfbe 100644 --- a/.github/workflows/publish_docs_to_wiki.yml +++ b/.github/workflows/publish_docs_to_wiki.yml @@ -3,7 +3,7 @@ name: Publish docs to Wiki on: push: paths: - - docs/** + - .github/wiki/** branches: - main - master diff --git a/bitrise.yml b/bitrise.yml index dcf07df9..5cc63440 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -7,6 +7,8 @@ trigger_map: workflow: deploy_staging - push_branch: master workflow: deploy_app_store +- push_branch: main + workflow: deploy_app_store - push_branch: release workflow: deploy_release_firebase - push_branch: "*" @@ -156,7 +158,7 @@ workflows: - lane: build_and_test - fastlane@3: inputs: - - lane: run_xcov + - lane: clean_up_xcov - danger@2: inputs: - github_api_token: "$DANGER_GITHUB_API_TOKEN" @@ -184,9 +186,3 @@ app: - opts: is_expand: false MATCH_REPO_URL: https://github.com/nimblehq/fastlane-match.git - - opts: - is_expand: false - INFO_PLIST_PATH: "./{PROJECT_NAME}/Info.plist" - - opts: - is_expand: false - GOOGLE_SERVICE_INFO_PLIST_PATH: "./{PROJECT_NAME}/GoogleService-Info.plist"