Init iOS build

This commit is contained in:
Rodrigo Nascimento 2017-11-06 16:27:01 -02:00
parent 4de4aa9ba8
commit b60b94c045
No known key found for this signature in database
GPG Key ID: CFCE33B7B01AC335
7 changed files with 313 additions and 18 deletions

View File

@ -3,7 +3,7 @@ defaults: &defaults
version: 2
jobs:
test:
lint-testunit:
<<: *defaults
docker:
- image: circleci/node:8
@ -35,7 +35,7 @@ jobs:
command: |
npx codecov
build:
android-build:
<<: *defaults
docker:
- image: circleci/android:api-26-alpha
@ -45,6 +45,7 @@ jobs:
JVM_OPTS: -Xmx2048m
TERM: dumb
BASH_ENV: "~/.nvm/nvm.sh"
steps:
- checkout
@ -54,7 +55,6 @@ jobs:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
source ~/.nvm/nvm.sh
nvm install 8
npm install
- restore_cache:
key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "package.json" }}
@ -103,11 +103,101 @@ jobs:
paths:
- ~/.gradle
ios-build:
macos:
xcode: "8.3.3"
environment:
BASH_ENV: "~/.nvm/nvm.sh"
steps:
- checkout
- run:
name: Install Node 8
command: |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
source ~/.nvm/nvm.sh
# https://github.com/creationix/nvm/issues/1394
set +e
nvm install 8
- run:
name: Update Fastlane
command: |
brew update
brew install ruby
sudo gem install fastlane
- run:
name: Install NPM modules
command: |
npm install
npm install react-native
- run:
name: Fix known build error
command: |
# Fix error https://github.com/facebook/react-native/issues/14382
cd node_modules/react-native/scripts/
curl https://raw.githubusercontent.com/facebook/react-native/5c53f89dd86160301feee024bce4ce0c89e8c187/scripts/ios-configure-glog.sh > ios-configure-glog.sh
chmod +x ios-configure-glog.sh
- run:
name: Fastlane Build
no_output_timeout: 1200
command: |
cd ios
fastlane ios build
- store_artifacts:
path: ios/RocketChatRN.ipa
- persist_to_workspace:
root: ios
paths:
- RocketChatRN.ipa
ios-testflight:
macos:
xcode: "8.3.3"
steps:
- checkout
- attach_workspace:
at: ios
- run:
name: Update Fastlane
command: |
brew update
brew install ruby
sudo gem install fastlane
- run:
name: Fastlane Tesflight Upload
command: |
cd ios
fastlane pilot upload
workflows:
version: 2
build-and-test:
jobs:
- test
- build:
- lint-testunit
- ios-build:
requires:
- test
- lint-testunit
- ios-hold-testflight:
type: approval
requires:
- ios-build
- ios-testflight:
requires:
- ios-hold-testflight
- android-build:
requires:
- lint-testunit

View File

@ -802,7 +802,8 @@
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
ProvisioningStyle = Automatic;
DevelopmentTeam = S6UPZG7ZR3;
ProvisioningStyle = Manual;
};
2D02E47A1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
@ -1378,9 +1379,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = S6UPZG7ZR3;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/realm/src/**",
@ -1399,10 +1401,10 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "chat.rocket.reactnative-chat.rocket.reactnative";
PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.reactnative;
PRODUCT_NAME = RocketChatRN;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE = "407d153d-67a5-4dde-9d17-372484b83cc1";
PROVISIONING_PROFILE_SPECIFIER = "match Development chat.rocket.reactnative";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
@ -1411,9 +1413,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = S6UPZG7ZR3;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/realm/src/**",
@ -1432,9 +1435,10 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "chat.rocket.reactnative-chat.rocket.reactnative";
PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.reactnative;
PRODUCT_NAME = RocketChatRN;
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE = "4215f8b9-b4d1-4531-8a64-a1b044835516";
PROVISIONING_PROFILE_SPECIFIER = "match AppStore chat.rocket.reactnative";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;

View File

@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>chat.rocket.reactnative</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@ -17,11 +17,13 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0</string>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2</string>
<string>4</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>

8
ios/fastlane/Appfile Normal file
View File

@ -0,0 +1,8 @@
app_identifier "chat.rocket.reactnative" # The bundle identifier of your app
apple_id "rodrigo.nascimento@rocket.chat" # Your Apple email address
team_id "S6UPZG7ZR3" # Developer Portal Team ID
itc_team_id "118376632"
# you can even provide different app identifiers, Apple IDs and team names per lane:
# More information: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Appfile.md

98
ios/fastlane/Fastfile Normal file
View File

@ -0,0 +1,98 @@
# Customize this file, documentation can be found here:
# https://docs.fastlane.tools/actions/
# All available actions: https://docs.fastlane.tools/actions
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "2.63.0"
default_platform :ios
platform :ios do
before_all do
# ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
# cocoapods
# carthage
create_keychain(
name: ENV["MATCH_KEYCHAIN_NAME"],
password: ENV["MATCH_KEYCHAIN_PASSWORD"],
timeout: 1200
)
end
desc "Runs all the tests"
lane :test do
scan
end
desc "Submit a new Beta Build to Apple TestFlight"
desc "This will also make sure the profile is up to date"
lane :beta do
match(
type: "appstore",
git_url: "git@github.com:RocketChat/Rocket.Chat.ReactNative.FastLane.git"
) # more information: https://codesigning.guide
gym(scheme: "RocketChatRN") # Build your app - more options available
pilot
# sh "your_script.sh"
# You can also use other beta testing services here (run `fastlane actions`)
end
desc "Deploy a new version to the App Store"
lane :release do
# match(type: "appstore")
# snapshot
match(
type: "appstore",
git_url: "git@github.com:RocketChat/Rocket.Chat.ReactNative.FastLane.git"
) # more information: https://codesigning.guide
deliver(force: true)
# frameit
end
desc "Build App"
lane :build do
# match(type: "appstore")
# snapshot
match(
type: "appstore",
git_url: "git@github.com:RocketChat/Rocket.Chat.ReactNative.FastLane.git"
) # more information: https://codesigning.guide
gym(scheme: "RocketChatRN") # Build your app - more options available
# frameit
end
# You can define as many lanes as you want
after_all do |lane|
# This block is called, only if the executed lane was successful
# slack(
# message: "Successfully deployed new App Update."
# )
delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"])
end
error do |lane, exception|
# slack(
# message: exception.message,
# success: false
# )
delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"])
end
end
# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
# All available actions: https://docs.fastlane.tools/actions
# fastlane reports which actions are used. No personal data is recorded.
# Learn more at https://docs.fastlane.tools/#metrics

60
ios/fastlane/README.md Normal file
View File

@ -0,0 +1,60 @@
fastlane documentation
================
# Installation
Make sure you have the latest version of the Xcode command line tools installed:
```
xcode-select --install
```
## Choose your installation method:
<table width="100%" >
<tr>
<th width="33%"><a href="http://brew.sh">Homebrew</a></td>
<th width="33%">Installer Script</td>
<th width="33%">RubyGems</td>
</tr>
<tr>
<td width="33%" align="center">macOS</td>
<td width="33%" align="center">macOS</td>
<td width="33%" align="center">macOS or Linux with Ruby 2.0.0 or above</td>
</tr>
<tr>
<td width="33%"><code>brew cask install fastlane</code></td>
<td width="33%"><a href="https://download.fastlane.tools">Download the zip file</a>. Then double click on the <code>install</code> script (or run it in a terminal window).</td>
<td width="33%"><code>sudo gem install fastlane -NV</code></td>
</tr>
</table>
# Available Actions
## iOS
### ios test
```
fastlane ios test
```
Runs all the tests
### ios beta
```
fastlane ios beta
```
Submit a new Beta Build to Apple TestFlight
This will also make sure the profile is up to date
### ios release
```
fastlane ios release
```
Deploy a new version to the App Store
### ios build
```
fastlane ios build
```
Build App
----
This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

33
ios/fastlane/report.xml Normal file
View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="fastlane.lanes">
<testcase classname="fastlane.lanes" name="0: Verifying required fastlane version" time="0.003408">
</testcase>
<testcase classname="fastlane.lanes" name="1: default_platform" time="0.003022">
</testcase>
<testcase classname="fastlane.lanes" name="2: match" time="12.238978">
</testcase>
<testcase classname="fastlane.lanes" name="3: gym" time="237.52302">
</testcase>
<testcase classname="fastlane.lanes" name="4: pilot" time="72.313015">
</testcase>
</testsuite>
</testsuites>