Skip to content

Commit

Permalink
Merge pull request #302 from nimblehq/release/3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
suho authored Jul 5, 2022
2 parents 23b751c + 713ed12 commit c06525d
Show file tree
Hide file tree
Showing 13 changed files with 189 additions and 28 deletions.
9 changes: 6 additions & 3 deletions .github/wiki/Bitrise.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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`.
<p align="center">
<img src="assets/images/bitrise/Bitrise-YML-Storage-Location.png" alt="Bitrise Store in-app repository" width="600"/>
<img src="assets/images/operations/bitrise/Bitrise-YML-Storage-Location.png" alt="Bitrise Store in-app repository" width="600"/>
</p>

4. Provide all the required variables and secrets.
Expand Down
150 changes: 150 additions & 0 deletions .github/wiki/Fastlane.md
Original file line number Diff line number Diff line change
@@ -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.

<img src="assets/images/infrastructure/fastlane/fastlane.png" width=300>

## 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.
6 changes: 4 additions & 2 deletions .github/wiki/Project-Configurations.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions .github/wiki/Self-Hosted-Github-Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:

Expand All @@ -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)
32 changes: 21 additions & 11 deletions .github/wiki/_Sidebar.md
Original file line number Diff line number Diff line change
@@ -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]]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/workflows/publish_docs_to_wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish docs to Wiki
on:
push:
paths:
- docs/**
- .github/wiki/**
branches:
- main
- master
Expand Down
10 changes: 3 additions & 7 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "*"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"

0 comments on commit c06525d

Please sign in to comment.