Skip to content

Commit

Permalink
Merge pull request #331 from nimblehq/release/3.9.0
Browse files Browse the repository at this point in the history
Release - 3.9.0
  • Loading branch information
markgravity authored Aug 30, 2022
2 parents c06525d + 5b29dc9 commit b8e8301
Show file tree
Hide file tree
Showing 20 changed files with 213 additions and 96 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# @suho is the Team Lead and the others are team member
* @suho @blyscuit @edgarss @markgravity @minhnimble @nmint8m @phongvhd93 @vnntsu @ducbm051291 @Shayokh144
# @markgravity is the Team Lead and the others are team member
* @suho @blyscuit @edgarss @markgravity @minhnimble @nmint8m @phongvhd93 @vnntsu @ducbm051291 @Shayokh144 @Thieurom @nkhanh44

# Engineering Leads
CODEOWNERS @nimblehq/engineering-leads
16 changes: 16 additions & 0 deletions .github/wiki/Deliverable-Configurations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Deliverable Configurations

The file [DeliverableConstants.rb](https://github.com/nimblehq/ios-templates/blob/develop/fastlane/Constants/DeliverableConstants.rb) contains the settings for build delivery, including:
- Firebase
- App Store

## Use the template

1. Running the `make.sh` script will ask if the developer wants to configure the `DeliverableConstants` file.
2. When confirming with the prompt, the template will launch Xcode to modify the `DeliverableConstants` file.

## Configure later

- Developer can modify the `DeliverableConstants` at any time.
- Use the command `sh deliverable_setup.sh` to open `DeliverableConstants` with Xcode.
- Open the file manually at `fastlane/Constants/DeliverableConstants.rb` with any IDE.
13 changes: 2 additions & 11 deletions .github/wiki/Project-Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@ Only include the dSYM file for release builds.
| Debug Production | |
| Release Production | ✔︎ |

### Enable Bitcode
### Disable Bitcode

Bitcode is a technology that enables recompiling applications to reduce their size. The recompilation happens when the application is uploaded to the App Store Connect or exported for Ad Hoc, Development, or Enterprise distribution.

Enable build with bitcode for Production only.

| Build configurations | Enable Bitcode |
|---|---|
| Debug Staging | |
| Release Staging | |
| Debug Production | |
| Release Production | ✔︎ |
- According to [Xcode 14 release notes](https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes): Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14. The capability to build with bitcode will be removed in a future Xcode release. IPAs that contain bitcode will have the bitcode stripped before being submitted to the App Store.
1 change: 1 addition & 0 deletions .github/wiki/_Sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- [[Home]]
- [[Getting Started]]
- [[Deliverable Configurations]]

## Architecture

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_AppStore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ name: Deploy Build To App Store
on:
push:
branches: [ master, main ]
workflow_dispatch:

jobs:
lint:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_Firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ name: Deploy Build To Firebase
on:
push:
branches: [ develop ]
workflow_dispatch:

jobs:
lint:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_Release_Firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ name: Deploy Release Build To Firebase
on:
push:
branches: [ release/** ]
workflow_dispatch:

jobs:
Lint:
Expand Down
4 changes: 4 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
--disable blankLinesAtStartOfScope
--stripunusedargs closure-only
--extensionacl on-declarations
--wraparguments before-first
--wrapparameters before-first
--wrapcollections before-first
--maxwidth 120
12 changes: 12 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,15 @@ implicit_return:
included:
- closure
- getter

custom_rules:
multiline_collection_one_per_line:
name: 'Multiline Collection One Per Line'
message: 'Collection should be either on the same line, or one per line.'
regex: '\[\n([^\[\(])*(,([^\n\r])*[\w]+)([^\[])*\n(\s)*]'
severity: warning
multiline_arguments_one_per_line:
name: 'Multiline Arguments One Per Line'
message: 'Arguments should be either on the same line, or one per line.'
regex: '[^\n\r]\(\n([^\(])*([^\n\r],([^\n\r])*[\w]+)([^\)])*\n(\s)*\)'
severity: warning
8 changes: 8 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ swiftlint.lint_files(
xcresultPath = "#{Constants.TEST_OUTPUT_DIRECTORY_PATH}/#{Constants.TESTS_SCHEME}.xcresult"

# Xcode summary
changed_files = (git.modified_files - git.deleted_files) + git.added_files
xcode_summary.ignored_results { |result|
if result.location
not changed_files.include?(result.location.file_path)
else
true
end
}
xcode_summary.ignored_files = 'Pods/**'
xcode_summary.inline_mode = true
xcode_summary.report xcresultPath
Expand Down
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
4 changes: 4 additions & 0 deletions Tuist/ProjectDescriptionHelpers/Target+Initializing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ extension Target {
platform: .iOS,
product: .app,
bundleId: bundleId,
deploymentTarget: .iOS(
targetVersion: "{TARGET_VERSION}",
devices: [.iphone]
),
infoPlist: "\(name)/\(plistsPath)/Info.plist",
sources: ["\(name)/Sources/**"],
resources: [
Expand Down
20 changes: 20 additions & 0 deletions deliverable_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
read -p "Which CI/CD service do you use (Can be edited later) [(g)ithub/(b)itrise/(l)ater]: " ciService

if [ "$ciService" = "g" -o "$ciService" = "github" ]; then
echo "Setting template for Github Actions"
rm bitrise.yml
elif [ "$ciService" = "b" -o "$ciService" = "bitrise" ]; then
echo "Setting template for Bitrise"
rm -rf .github/workflows
else
echo "You can manually setup the template later."
fi
echo "✅ Completed"

read -n1 -p "Do you want to set up Deliverable Constants values? (Can be edited later) [Y/n]:" confirm
if ! echo $confirm | grep '^[Yy]\?$'; then
echo "✅ Completed"
else
open -a Xcode fastlane/Constants/DeliverableConstants.rb
fi
62 changes: 0 additions & 62 deletions fastlane/Constants/Constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,45 +73,6 @@ def self.TEST_OUTPUT_DIRECTORY_PATH
'./fastlane/test_output'
end

##################
#### FIREBASE ####
##################

# a gsp files directory
def self.GSP_DIRECTORY
'./'
end

# a gsp file name for staging
def self.GSP_STAGING
'./{PROJECT_NAME}/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist'
end

# a gsp file name for production
def self.GSP_PRODUCTION
'./{PROJECT_NAME}/Configurations/Plists/GoogleService/Production/GoogleService-Info.plist'
end

# The path to the upload-symbols file of the Fabric app
def self.BINARY_PATH
'./Pods/FirebaseCrashlytics/upload-symbols'
end

# a firebase app ID for Staging
def self.FIREBASE_APP_ID_STAGING
'{PROJECT_FIREBASE_APP_ID}'
end

# a firebase app ID for Production
def self.FIREBASE_APP_ID_PRODUCTION
'{PROJECT_FIREBASE_APP_ID}'
end

# Firebase Tester group name, seperate by comma(,) string
def self.FIREBASE_TESTER_GROUPS
"nimble-dev"
end

#################
#### KEYCHAIN ####
#################
Expand Down Expand Up @@ -165,27 +126,4 @@ def self.MAIN_TARGET_NAME
'{PROJECT_NAME}'
end

##################
### DEV PORTAL ###
##################

# Apple ID for Apple Developer Portal
def self.DEV_PORTAL_APPLE_ID
'{[email protected]}'
end

#####################
### App Store API ###
#####################

# App Store Connect API Key ID
def self.APP_STORE_KEY_ID
'{API_KEY_ID}'
end

# App Store Connect API Issuer ID
def self.APP_STORE_ISSUER_ID
'{ISSUER_ID}'
end

end
67 changes: 67 additions & 0 deletions fastlane/Constants/DeliverableConstants.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# frozen_string_literal: true

class DeliverableConstants

##################
#### FIREBASE ####
##################

# a gsp files directory
def self.GSP_DIRECTORY
'./'
end

# a gsp file name for staging
def self.GSP_STAGING
'./{PROJECT_NAME}/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist'
end

# a gsp file name for production
def self.GSP_PRODUCTION
'./{PROJECT_NAME}/Configurations/Plists/GoogleService/Production/GoogleService-Info.plist'
end

# The path to the upload-symbols file of the Fabric app
def self.BINARY_PATH
'./Pods/FirebaseCrashlytics/upload-symbols'
end

# a firebase app ID for Staging
def self.FIREBASE_APP_ID_STAGING
'<#PROJECT_FIREBASE_APP_ID#>'
end

# a firebase app ID for Production
def self.FIREBASE_APP_ID_PRODUCTION
'<#PROJECT_FIREBASE_APP_ID#>'
end

# Firebase Tester group name, seperate by comma(,) string
def self.FIREBASE_TESTER_GROUPS
"nimble-dev"
end

##################
### DEV PORTAL ###
##################

# Apple ID for Apple Developer Portal
def self.DEV_PORTAL_APPLE_ID
'<#[email protected]#>'
end

#####################
### App Store API ###
#####################

# App Store Connect API Key ID
def self.APP_STORE_KEY_ID
'<#API_KEY_ID#>'
end

# App Store Connect API Issuer ID
def self.APP_STORE_ISSUER_ID
'<#ISSUER_ID#>'
end

end
33 changes: 19 additions & 14 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require './Constants/Constants'
require './Constants/Environments'
require './Constants/DeliverableConstants'
require './Managers/VersioningManager'
require './Managers/BuildManager'
require './Managers/SymbolManager'
Expand Down Expand Up @@ -33,7 +34,8 @@ match_manager = MatchManager.new(
fastlane: self,
keychain_name: Constants.KEYCHAIN_NAME,
keychain_password: Constants.KEYCHAIN_PASSWORD,
is_ci: Environments.CI
is_ci: Environments.CI,
username: DeliverableConstants.DEV_PORTAL_APPLE_ID
)

before_all do
Expand Down Expand Up @@ -87,7 +89,10 @@ platform :ios do
device_udid = prompt(text: 'Enter the device UDID: ')
device_hash = {}
device_hash[device_name] = device_udid
register_devices(devices: device_hash)
register_devices(
devices: device_hash,
username: DeliverableConstants.DEV_PORTAL_APPLE_ID
)

match_manager.sync_development_signing(app_identifier: nil, force: true)
match_manager.sync_adhoc_signing(app_identifier: nil, force: true)
Expand All @@ -107,12 +112,12 @@ platform :ios do
)
upload_build_to_firebase(
product_name: Constants.PRODUCT_NAME_PRODUCTION,
firebase_app_id: Constants.FIREBASE_APP_ID_PRODUCTION,
tester_groups: Constants.FIREBASE_TESTER_GROUPS
firebase_app_id: DeliverableConstants.FIREBASE_APP_ID_STAGING,
tester_groups: DeliverableConstants.FIREBASE_TESTER_GROUPS
)
upload_build_dsym_to_firebase(
product_name: Constants.PRODUCT_NAME_PRODUCTION,
gsp_name: Constants.GSP_PRODUCTION
product_name: Constants.PRODUCT_NAME_STAGING,
gsp_name: DeliverableConstants.GSP_STAGING
)
end

Expand All @@ -127,12 +132,12 @@ platform :ios do
)
upload_build_to_firebase(
product_name: Constants.PRODUCT_NAME_PRODUCTION,
firebase_app_id: Constants.FIREBASE_APP_ID_PRODUCTION,
tester_groups: Constants.FIREBASE_TESTER_GROUPS
firebase_app_id: DeliverableConstants.FIREBASE_APP_ID_PRODUCTION,
tester_groups: DeliverableConstants.FIREBASE_TESTER_GROUPS
)
upload_build_dsym_to_firebase(
product_name: Constants.PRODUCT_NAME_PRODUCTION,
gsp_name: Constants.GSP_PRODUCTION
gsp_name: DeliverableConstants.GSP_PRODUCTION
)
end

Expand All @@ -154,8 +159,8 @@ platform :ios do
version: versioning_manager.version_number,
build_number: versioning_manager.build_number,
build_path: Constants.BUILD_PATH,
gsp_directory: Constants.GSP_DIRECTORY,
binary_path: Constants.BINARY_PATH
gsp_directory: DeliverableConstants.GSP_DIRECTORY,
binary_path: DeliverableConstants.BINARY_PATH
)

symbol_manager.upload_built_symbol_to_firebase(
Expand All @@ -180,7 +185,7 @@ platform :ios do
upload_build_to_appstore
upload_build_dsym_to_firebase(
product_name: Constants.PRODUCT_NAME_PRODUCTION,
gsp_name: Constants.GSP_PRODUCTION
gsp_name: DeliverableConstants.GSP_PRODUCTION
)
end

Expand All @@ -195,8 +200,8 @@ platform :ios do
desc 'set App Store Connect API Key'
private_lane :set_connect_api_key do
app_store_connect_api_key(
key_id: Constants.APP_STORE_KEY_ID,
issuer_id: Constants.APP_STORE_ISSUER_ID,
key_id: DeliverableConstants.APP_STORE_KEY_ID,
issuer_id: DeliverableConstants.APP_STORE_ISSUER_ID,
key_content: Environments.APPSTORE_CONNECT_API_KEY || ''
)
end
Expand Down
Loading

0 comments on commit b8e8301

Please sign in to comment.