-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…pport [#315] CI/CD - Add support for Codemagic CI/CD service
- Loading branch information
Showing
7 changed files
with
200 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# CodeMagic | ||
|
||
Use the CodeMagic template to start a new project with CodeMagic as the CI/CD tool. | ||
|
||
## Workflows and Steps | ||
|
||
Out of the box, the CodeMagic Template has the following workflows and steps: | ||
|
||
| test | deploy_app_store | deploy_staging_firebase | deploy_release_firebase | | ||
| --------------------------- | ------------------------------------------------------- | --------------------------------------------------- | ----------------------------------------------------- | | ||
| Install bundle | Install bundle | Install bundle | Install bundle | | ||
| Run CocoaPods install | Run CocoaPods install | Run CocoaPods install | Run CocoaPods install | | ||
| Fastlane - Build and Test | Fastlane - Build and Test | Fastlane - Build and Test | Fastlane - Build and Test | | ||
| Fastlane - Clean Up Xcov | Fastlane Match | Fastlane Match | Fastlane Match | | ||
| Fastlane - Build and deploy | Fastlane - Build and Upload Production App to App Store | Fastlane - Build and Upload Staging App to Firebase | Fastlane: Build and Upload Production App to Firebase | | ||
| Danger | N/A | N/A | N/A | | ||
|
||
## Trigger Map | ||
|
||
| Workflow | Trigger | | ||
| ----------------------- | ----------------------- | | ||
| test | Create or Update a PR | | ||
| deploy_staging | Push branch `develop` | | ||
| deploy_release_firebase | Push branch `release/*` | | ||
| deploy_app_store | Push branch `main` | | ||
|
||
## Environment | ||
|
||
### Variables | ||
|
||
| Key | Description | | ||
| --------------------------- | ------------------------------------------------------------ | | ||
| MATCH_PASSWORD | The password is used to encrypt/decrypt the Match repository to store the distribution certificates and provisioning profiles. | | ||
| MATCH_SSH_KEY | The SSH private key is used for cloning the Match repository that contains your distribution certificates and provisioning. | | ||
| KEYCHAIN_PASSWORD | The password to access the keychain. | | ||
| FIREBASE_CLI_TOKEN | [Firebase token](https://firebase.google.com/docs/cli#cli-ci-systems) for uploading build to Firebase Distributions and Analytics. | | ||
| APPSTORE_CONNECT_API_KEY | [App Store Connect API](https://docs.fastlane.tools/actions/app_store_connect_api_key/) for uploading build to TestFlight or App Store. It should be `base64` encoded. | | ||
| API_KEY_ID | The key identifier of your App Store Connect API key. | | ||
| ISSUER_ID | The issuer of your App Store Connect API key. | | ||
| BUMP_APP_STORE_BUILD_NUMBER | The boolean flag to determine if the Fastlane should bump the app store build number. | | ||
| GITHUB_TOKEN | The token of GitHub to run Danger. | | ||
|
||
## Installation | ||
|
||
1. Follow the setup instruction in [`README.md`](https://github.com/nimblehq/ios-templates#readme). | ||
|
||
2. To connect the repository to CodeMagic, please follow the instruction on [Adding the app to CodeMagic](https://docs.codemagic.io/yaml-quick-start/building-a-native-ios-app). | ||
|
||
3. Provide all the required variables and secrets. | ||
|
||
The final project directory structure should be like this: | ||
|
||
``` | ||
ROOT | ||
├── ExampleApp.xcworkspace | ||
├── codemagic.yaml | ||
├──... | ||
``` | ||
|
||
4. Push changes to SCM. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
workflows: | ||
deploy_staging_firebase: | ||
name: Deploy Staging Build To Firebase | ||
instance_type: mac_mini_m1 | ||
environment: | ||
groups: | ||
- fastlane | ||
xcode: latest | ||
cocoapods: default | ||
cache: | ||
cache_paths: | ||
- $HOME/Library/Caches/CocoaPods | ||
triggering: | ||
events: | ||
- push | ||
branch_patterns: | ||
- pattern: 'develop' | ||
include: true | ||
source: true | ||
scripts: | ||
- name: Install bundle | ||
script: bundle install --path vendor/bundle | ||
- name: Install Pods Dependencies | ||
script: bundle exec pod install | ||
- name: Build and Test | ||
script: bundle exec fastlane buildAndTest | ||
- name: Match Ad-hoc | ||
script: bundle exec fastlane syncAdHocStagingCodeSigning | ||
- name: Build App and Distribute to Firebase | ||
script: bundle exec fastlane buildStagingAndUploadToFirebase | ||
artifacts: | ||
- ./Output/*.ipa | ||
- ./Output/*.dSYM.zip | ||
deploy_production_firebase: | ||
name: Deploy Production Build To Firebase | ||
instance_type: mac_mini_m1 | ||
environment: | ||
groups: | ||
- fastlane | ||
xcode: latest | ||
cocoapods: default | ||
cache: | ||
cache_paths: | ||
- $HOME/Library/Caches/CocoaPods | ||
triggering: | ||
events: | ||
- push | ||
branch_patterns: | ||
- pattern: 'release/*' | ||
include: true | ||
source: true | ||
scripts: | ||
- name: Install bundle | ||
script: bundle install --path vendor/bundle | ||
- name: Install Pods Dependencies | ||
script: bundle exec pod install | ||
- name: Build and Test | ||
script: bundle exec fastlane buildAndTest | ||
- name: Match Ad-hoc | ||
script: bundle exec fastlane syncAdHocProductionCodeSigning | ||
- name: Build App and Distribute to Firebase | ||
script: bundle exec fastlane buildProductionAndUploadToFirebase | ||
artifacts: | ||
- ./Output/*.ipa | ||
- ./Output/*.dSYM.zip | ||
deploy_app_store: | ||
name: Deploy Build To App Store | ||
instance_type: mac_mini_m1 | ||
environment: | ||
groups: | ||
- fastlane | ||
xcode: latest | ||
cocoapods: default | ||
cache: | ||
cache_paths: | ||
- $HOME/Library/Caches/CocoaPods | ||
triggering: | ||
events: | ||
- push | ||
branch_patterns: | ||
- pattern: 'main' | ||
include: true | ||
source: true | ||
scripts: | ||
- name: Install bundle | ||
script: bundle install --path vendor/bundle | ||
- name: Install Pods Dependencies | ||
script: bundle exec pod install | ||
- name: Build and Test | ||
script: bundle exec fastlane buildAndTest | ||
- name: Match AppStore | ||
script: bundle exec fastlane syncAppStoreCodeSigning | ||
- name: Build App and Distribute to AppStore | ||
script: bundle exec fastlane buildAndUploadToAppStore | ||
artifacts: | ||
- ./Output/*.ipa | ||
- ./Output/*.dSYM.zip | ||
test: | ||
name: Test | ||
instance_type: mac_mini_m1 | ||
environment: | ||
groups: | ||
- fastlane | ||
xcode: latest | ||
cocoapods: default | ||
cache: | ||
cache_paths: | ||
- $HOME/Library/Caches/CocoaPods | ||
triggering: | ||
events: | ||
- pull_request | ||
branch_patterns: | ||
- pattern: '*' | ||
include: true | ||
source: true | ||
scripts: | ||
- name: Install bundle | ||
script: bundle install --path vendor/bundle | ||
- name: Install Pods Dependencies | ||
script: bundle exec pod install | ||
- name: Build and Test | ||
script: bundle exec fastlane buildAndTest | ||
- name: Clean Up | ||
script: bundle exec fastlane cleanUpOutput | ||
- name: Danger | ||
script: bundle exec danger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters