Skip to content

Commit

Permalink
feat(ios): set certificates
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Froment <sfroment42@gmail.com>
  • Loading branch information
sfroment committed Aug 8, 2018
1 parent 5bf4e94 commit f8a2f7d
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 54 deletions.
27 changes: 16 additions & 11 deletions .circleci/config.yml
Expand Up @@ -190,7 +190,7 @@ jobs:
client.rn.ios:
working_directory: ~/go/src/github.com/berty/berty
macos:
xcode: "9.0"
xcode: "9.4.1"
environment:
FL_OUTPUT_DIR: output
shell: /bin/bash --login -o pipefail
Expand All @@ -199,6 +199,11 @@ jobs:
name: set Ruby version
command: echo "ruby-2.4" > ~/.ruby-version

- checkout

- attach_workspace:
at: ~/go/src/github.com/berty/berty/

- restore_cache:
key: ios-golang-{{ .Environment.GOVERSION }}-2

Expand Down Expand Up @@ -230,31 +235,29 @@ jobs:
- ~/go
- ~/go-install

- checkout

- run:
name: install core
working_directory: ~/go/src/github.com/berty/berty/client/react-native/gomobile
command: |
make core.build.ios
# - restore_cache:
# key: ios-gems-{{ checksum "~/go/src/github.com/berty/berty/client/react-native/mobile/ios/Gemfile.lock" }}-1
- restore_cache:
key: ios-gems-{{ checksum "~/go/src/github.com/berty/berty/client/react-native/mobile/ios/Gemfile.lock" }}-3

- run:
working_directory: ~/go/src/github.com/berty/berty/client/react-native/mobile/ios
command: bundle check || bundle install --path vendor/bundle

# - save_cache:
# key: ios-gems-{{ checksum "~/go/src/github.com/berty/berty/client/react-native/mobile/ios/Gemfile.lock" }}-1
# paths:
# - vendor/bundle
- save_cache:
key: ios-gems-{{ checksum "~/go/src/github.com/berty/berty/client/react-native/mobile/ios/Gemfile.lock" }}-3
paths:
- client/react-native/mobile/ios/vendor/bundle

- run:
name: build app
working_directory: ~/go/src/github.com/berty/berty/client/react-native/mobile/ios
command: |
time bundle exec fastlane ios adhoc --verbose
time bundle exec fastlane ios adhoc refresh_certificates:true use_temporary_keychain:true --verbose
workflows:
version: 2
Expand All @@ -267,4 +270,6 @@ workflows:
- client.rn.android:
requires:
- client.rn.node
- client.rn.ios
- client.rn.ios:
requires:
- client.rn.node
16 changes: 8 additions & 8 deletions client/react-native/mobile/ios/berty.xcodeproj/project.pbxproj
Expand Up @@ -694,7 +694,7 @@
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = 7A4249AYMN;
ProvisioningStyle = Automatic;
ProvisioningStyle = Manual;
};
2D02E47A1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
Expand Down Expand Up @@ -1210,7 +1210,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 7A4249AYMN;
Expand All @@ -1221,9 +1221,9 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = chat.berty;
PRODUCT_BUNDLE_IDENTIFIER = chat.berty.tech;
PRODUCT_NAME = berty;
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE_SPECIFIER = "match Development chat.berty.tech";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
Expand All @@ -1232,8 +1232,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 7A4249AYMN;
INFOPLIST_FILE = berty/Info.plist;
Expand All @@ -1243,9 +1243,9 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = chat.berty;
PRODUCT_BUNDLE_IDENTIFIER = chat.berty.tech;
PRODUCT_NAME = berty;
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE_SPECIFIER = "match AdHoc chat.berty.tech";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
Expand Down
6 changes: 0 additions & 6 deletions client/react-native/mobile/ios/fastlane/Appfile

This file was deleted.

116 changes: 91 additions & 25 deletions client/react-native/mobile/ios/fastlane/Fastfile
@@ -1,31 +1,97 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)
# # This file contains the fastlane.tools configuration
# # You can find the documentation at https://docs.fastlane.tools
# #
# # For a list of all available actions, check out
# #
# # https://docs.fastlane.tools/actions
# #
# # For a list of all available plugins, check out
# #
# # https://docs.fastlane.tools/plugins/available-plugins
# #

# # Uncomment the line if you want fastlane to automatically update itself
# # update_fastlane

fastlane_version "2.76.1"

default_platform :ios

platform :ios do
desc "Description of what the lane does"
lane :custom_lane do
# add actions here: https://docs.fastlane.tools/actions
end

desc "Ad-hoc build"
lane :adhoc do
match(type: "adhoc")
# snapshot
gym(export_method: "ad-hoc", scheme: "berty")
####### Certificates #######

desc "Installs the certificates and profiles locally"
lane :certificates do |options|
if options[:use_temporary_keychain]
create_temporary_keychain
end

readonly = (options[:refresh_certificates] ? false : true)
# force_for_new_devices = !readonly

match(
app_identifier: "chat.berty.tech",
# team_id: "XXX",
type: "development",
readonly: true,
# force_for_new_devices: force_for_new_devices
)

match(
# git_branch: "Company-Enterprise",
app_identifier: "chat.berty.tech",
# team_id: "XXX",
type: "adhoc",
readonly: true,
)

if options[:use_temporary_keychain]
sh "security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k #{ENV["KEYCHAIN_NAME"]} #{ENV["KEYCHAIN_PASSWORD"]}"
end
end

private_lane :create_temporary_keychain do
keychain_name = "temporary_keychain"
ENV["KEYCHAIN_NAME"] = keychain_name
ENV["KEYCHAIN_PASSWORD"] = keychain_name
ENV["MATCH_KEYCHAIN_NAME"] = keychain_name
ENV["MATCH_KEYCHAIN_PASSWORD"] = keychain_name

create_keychain(
default_keychain: true,
unlock: true,
timeout: 3600,
add_to_search_list: true
)
end ####### Builds #######

desc "Submit a new Alpha Build to Fabric"

desc "Submit a new build to iTunes Connect"
lane :adhoc do |options|
certificates(
use_temporary_keychain: options[:use_temporary_keychain],
refresh_certificates: options[:refresh_certificates]
)

increment_build_number(
build_number: ENV["BUILD_NUMBER"]
)

gym(
verbose: true,
configuration: "Debug",
scheme: "berty",
clean: true,
include_symbols: true,
export_method: "development",
export_options: {
provisioningProfiles: {
"chat.berty.tech" => "match Development chat.berty.tech"
}
}
)
end

end
6 changes: 2 additions & 4 deletions client/react-native/mobile/ios/fastlane/Matchfile
@@ -1,9 +1,7 @@
git_url("git@github.com:berty/ios-certs.git")

type("development") # The default type, can be: appstore, adhoc, enterprise or development

app_identifier(["tech.berty.chat"])
# username("user@fastlane.tools") # Your Apple Developer Portal username
# type("development") # The default type, can be: appstore, adhoc, enterprise or development
username("pnj@united-drivers.cab") # Your Apple Developer Portal username

# For all available options run `fastlane match --help`
# Remove the # in the beginning of the line to enable the other options

0 comments on commit f8a2f7d

Please sign in to comment.