diff --git a/.travis.yml b/.travis.yml index 4ba17fd..5a9f968 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,9 @@ language: objective-c osx_image: xcode8.2 +branches: + only: + - develop +before_install: + - echo -e "machine github.com\n login $GITHUB_ACCESS_TOKEN" >> ~/.netrc script: - ./fastlane/travis.sh diff --git a/fastlane/Fastfile b/fastlane/Fastfile index d6bf447..ca14983 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -21,28 +21,58 @@ platform :ios do carthage(platform: "iOS") end + desc "Travis" + lane :travis do + test + beta + end + desc "Runs all the tests" lane :test do - scan(scheme: "pass") + scan( + scheme: "pass", + device: "iPhone 7" + ) 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") # more information: https://codesigning.guide - ensure_git_status_clean + create_keychain( + name: ENV["MATCH_KEYCHAIN_NAME"], + password: ENV["MATCH_KEYCHAIN_PASSWORD"], + default_keychain: true, + unlock: true, + timeout: 3600, + add_to_search_list: true + ) + match( + type: "appstore", + keychain_name: ENV["MATCH_KEYCHAIN_NAME"], + keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"], + readonly: true + ) + # ensure_git_status_clean increment_build_number( build_number: latest_testflight_build_number + 1, xcodeproj: "pass.xcodeproj" ) - commit_version_bump(xcodeproj: "pass.xcodeproj") - push_to_git_remote - gym(scheme: "pass") # Build your app - more options available - testflight - # pilot(skip_waiting_for_build_processing: true) - - # sh "your_script.sh" - # You can also use other beta testing services here (run `fastlane actions`) + # commit_version_bump(xcodeproj: "pass.xcodeproj") + # push_to_git_remote + gym(scheme: "pass") + pilot(skip_waiting_for_build_processing: true) + mailgun( + postmaster: ENV["MY_POSTMASTER"], + apikey: ENV["MY_API_KEY"], + to: ENV["DESTINATION_EMAIL"], + from: ENV["EMAIL_FROM_NAME"], + reply_to: ENV["EMAIL_REPLY_TO"], + subject: "A new build of Pass for iOS has been uploaded", + success: true, + app_link: "https://github.com/mssun/passforios", + ci_build_link: "https://travis-ci.org/mssun/passforios", + message: "A new build has been uploaded by Travis CI.", + ) end desc "Deploy a new version to the App Store" @@ -57,18 +87,9 @@ platform :ios do # 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." - # ) end error do |lane, exception| - # slack( - # message: exception.message, - # success: false - # ) end end diff --git a/fastlane/Matchfile b/fastlane/Matchfile new file mode 100644 index 0000000..7a59cec --- /dev/null +++ b/fastlane/Matchfile @@ -0,0 +1,9 @@ +git_url "https://github.com/mssun/certificates-passforios.git" + +type "development" # The default type, can be: appstore, adhoc, enterprise or development + +# app_identifier ["tools.fastlane.app", "tools.fastlane.app2"] +# username "user@fastlane.tools" # 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 diff --git a/fastlane/travis.sh b/fastlane/travis.sh index 2804715..1f3e185 100755 --- a/fastlane/travis.sh +++ b/fastlane/travis.sh @@ -1,5 +1,9 @@ #!/bin/sh gem update fastlane -fastlane test +if [ "$TRAVIS_PULL_REQUEST" == "true" ]; then + fastlane test; +else + fastlane travis; +fi exit $? diff --git a/pass.xcodeproj/project.pbxproj b/pass.xcodeproj/project.pbxproj index ed2cae9..249ecec 100644 --- a/pass.xcodeproj/project.pbxproj +++ b/pass.xcodeproj/project.pbxproj @@ -379,7 +379,7 @@ DC917BD21E2E8231000FDF54 = { CreatedOnToolsVersion = 8.2.1; DevelopmentTeam = 4WDM8E95VU; - ProvisioningStyle = Automatic; + ProvisioningStyle = Manual; }; }; }; @@ -732,6 +732,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = me.mssun.passforios; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = "893c10b3-79b1-46f7-914a-e625bf10d665"; + PROVISIONING_PROFILE_SPECIFIER = "match Development me.mssun.passforios"; SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/pass/Helpers/Objective-CBridgingHeader.h"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -744,7 +746,7 @@ baseConfigurationReference = AEAD6B31EAF5D061447A68CC /* Pods-pass.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CURRENT_PROJECT_VERSION = 2; DEFINES_MODULE = NO; DEVELOPMENT_TEAM = 4WDM8E95VU; @@ -764,6 +766,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = me.mssun.passforios; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = "aefeea85-1194-4db2-9ce4-fb9995e2fdff"; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore me.mssun.passforios"; SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/pass/Helpers/Objective-CBridgingHeader.h"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -781,6 +785,7 @@ DC13B1561E8640810097803F /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; DC917BCE1E2E8231000FDF54 /* Build configuration list for PBXProject "pass" */ = { isa = XCConfigurationList;