1+ require 'securerandom'
2+
13fastlane_version "1.47.0"
24
35default_platform :ios
@@ -8,5 +10,58 @@ platform :ios do
810 lane :test do
911 scan ( device : "iPhone 6s (9.2)" )
1012 end
13+
14+ desc "Submit a new Beta build to Hockey App"
15+ lane :beta do
16+
17+ keychain_name = "ci-example-certs"
18+
19+ create_keychain (
20+ name : keychain_name ,
21+ default_keychain : true ,
22+ unlock : true ,
23+ timeout : 3600 ,
24+ lock_when_sleeps : true ,
25+ password : SecureRandom . base64
26+ )
27+
28+ # Import distribution certificate
29+ import_certificate (
30+ certificate_path : "fastlane/Certificates/distribution.p12" ,
31+ certificate_password : ENV [ "KEY_PASSWORD" ] ,
32+ keychain_name : keychain_name
33+ )
34+
35+ sigh (
36+ adhoc : true ,
37+ 38+ team_id : "XA8U8K5RRK" ,
39+ provisioning_name : "CI Example Ad Hoc" ,
40+ cert_id : "2T3HB2838A"
41+ )
42+
43+ increment_build_number ( build_number : number_of_commits )
44+
45+ # Build
46+ gym (
47+ configuration : "Ad Hoc" ,
48+ sdk : "iphoneos9.2" ,
49+ clean : true ,
50+ include_bitcode : false ,
51+ include_symbols : true ,
52+ use_legacy_build_api : true ,
53+ export_method : "enterprise"
54+ )
55+
56+ # Push to Hockey
57+ hockey (
58+ api_token : ENV [ "HOCKEY_API_TOKEN" ] ,
59+ public_identifier : ENV [ "HOCKEY_APP_ID" ] ,
60+ notify : '0' ,
61+ status : '2' ,
62+ notes : last_git_commit [ :message ] + "\n (Uploaded automatically via fastlane)"
63+ )
64+
65+ end
1166end
1267
0 commit comments