From f87c3c499619b155667cabb0af11183b0ff7ff33 Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Tue, 12 May 2015 20:29:24 +0100 Subject: [PATCH 1/2] Added fastlane configuration files [fastlane](https://fastlane.tools) is an established Continuous Delivery solution for iOS/Mac projects. The configuration files are similar to a `Podfile`, also Ruby based. Some examples: - https://github.com/wikimedia/apps-ios-wikipedia/blob/master/fastlane/Fastfile - https://github.com/wikimedia/apps-ios-wikipedia/blob/master/fastlane/Deliverfile - https://github.com/artsy/eidolon/blob/master/fastlane/Fastfile - https://github.com/fastlane/examples/blob/master/MindNode/Fastfile The configuration files added with this pull request: `Fastfile`, `Deliverfile` and `Snapfile` :+1: --- lib/linguist/languages.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 1159d79c..5de157cd 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2833,6 +2833,8 @@ Ruby: - Appraisals - Berksfile - Buildfile + - Deliverfile + - Fastfile - Gemfile - Gemfile.lock - Guardfile @@ -2840,6 +2842,7 @@ Ruby: - Mavenfile - Podfile - Puppetfile + - Snapfile - Thorfile - Vagrantfile - buildfile From fd4111cdbe383208a9f9efd498ddb6a88a05f96a Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Wed, 13 May 2015 11:02:26 +0100 Subject: [PATCH 2/2] Added Example Ruby Files --- samples/Ruby/filenames/Deliverfile | 50 +++++++++++++ samples/Ruby/filenames/Fastfile | 115 +++++++++++++++++++++++++++++ samples/Ruby/filenames/Podfile | 18 +++++ samples/Ruby/filenames/Snapfile | 26 +++++++ 4 files changed, 209 insertions(+) create mode 100644 samples/Ruby/filenames/Deliverfile create mode 100644 samples/Ruby/filenames/Fastfile create mode 100644 samples/Ruby/filenames/Podfile create mode 100644 samples/Ruby/filenames/Snapfile diff --git a/samples/Ruby/filenames/Deliverfile b/samples/Ruby/filenames/Deliverfile new file mode 100644 index 00000000..bd8b463d --- /dev/null +++ b/samples/Ruby/filenames/Deliverfile @@ -0,0 +1,50 @@ +require 'open-uri' + +framework_version = JSON.parse(open(url).read) + +# The URL below is password protected +apps = JSON.parse(open(url).read) + +app_id = Dir.pwd.split("/")[-2].to_i +app = apps[app_id.to_s] + +# The app identifier is required +app_identifier "net.sunapps.#{app_id}" + +version framework_version['version_number'] + +title( + 'de-DE' => app["fullName"] +) + +description( + 'de-DE' => app["description"]["de"] +) + +changelog( + 'de-DE' => framework_version["public_description"]["de"] +) + +keywords( + 'de-DE' => app["keywords"]["de"].split(",") +) + +app_icon "../Submission/AppIconFull.png" + +price_tier 0 # free app + +primary_category "Reference" + +secondary_category "Business" + +automatic_release true + +ratings_config_path "./ratings_config.json" + +app_review_information({ + first_name: "Felix", + phone_number: "My Phone Number", + demo_user: "", + demo_password: "", + notes: "" +}) \ No newline at end of file diff --git a/samples/Ruby/filenames/Fastfile b/samples/Ruby/filenames/Fastfile new file mode 100644 index 00000000..aed95f6f --- /dev/null +++ b/samples/Ruby/filenames/Fastfile @@ -0,0 +1,115 @@ +# Customise this file, documentation can be found here: +# https://github.com/KrauseFx/fastlane/tree/master/docs + +$:.unshift File.dirname(__FILE__) +require 'lib/utils.rb' + +fastlane_version "1.0.0" + +default_platform :ios + +platform :ios do + before_all do + ENV['DELIVER_WHAT_TO_TEST'] = git_commit_log + ensure_git_status_clean + end + + desc "Runs linting (and eventually static analysis)" + lane :analyze do + return if test_disabled? + make 'lint' + end + + desc "Runs all the unit tests." + lane :test do + return if test_disabled? + # TODO: lint & test JS code + xctest( + scheme: 'Wikipedia', + destination: "platform=iOS Simulator,name=iPhone 6,OS=8.3", + reports: [ + { + report: "html", + output: "build/reports/unit-tests.html" + }, + { + report: "junit", + output: "build/reports/unit-tests.xml" + } + ], + clean: nil + ) + end + + desc "Bump the version, and submit a new **Wikipedia Alpha** Build to Apple TestFlight" + lane :alpha do + # snapshot + sigh + increment_build_number + + # uncomment when CI is able to push tags + if ENV['WMF_BUMP'] + commit_version_bump + plist_version = get_version_short_string File.expand_path(File.join(ENV['PWD'], 'Wikipedia/Wikipedia-Info.plist')) + # tag must be added after the version bump is committed + add_git_tag(tag: "#{plist_version}.#{Actions.lane_context[Actions::SharedValues::BUILD_NUMBER]}") + end + + ipa( + configuration: "Alpha", + scheme: "Wikipedia Alpha", + ) + hockey( + notes: '', + notify: '0', # Means do not notify + status: '1', # Means do not make available for download + ) + deliver skip_deploy: true, beta: true + + # uncomment when CI is able to push tags + if ENV['WMF_BUMP'] + # only push after everything else has succeeded + push_to_git_remote + end + end + + desc "Submit a new **Wikipedia Beta** build to Apple TestFlight" + lane :beta do + # snapshot + sigh + ipa( + configuration: "Beta", + scheme: "Wikipedia Beta", + ) + hockey( + notes: '', + notify: '0', # Means do not notify + status: '1', # Means do not make available for download + ) + deliver skip_deploy: true, beta: true + end + + desc "Deploy a new version to the App Store" + lane :store do + # snapshot + sigh + ipa( + configuration: "Wikipedia", + scheme: "Wikipedia", + ) + hockey( + notes: '', + notify: '0', # Means do not notify + status: '1', # Means do not make available for download + ) + deliver skip_deploy: true, force: true + end + + after_all do |lane| + + end + + error do |lane, exception| + + end +end \ No newline at end of file diff --git a/samples/Ruby/filenames/Podfile b/samples/Ruby/filenames/Podfile new file mode 100644 index 00000000..2a03e4ae --- /dev/null +++ b/samples/Ruby/filenames/Podfile @@ -0,0 +1,18 @@ +source 'https://github.com/CocoaPods/Specs.git' + +platform :ios, :deployment_target => '6.0' + +inhibit_all_warnings! + +xcodeproj 'Wikipedia' + +pod 'AFNetworking/NSURLConnection', '~> 2.5' +pod 'hpple', '~> 0.2' +pod 'blockskit/Core', '~> 2.2' +pod 'Masonry', '~> 0.6' +pod 'HockeySDK', '3.6.2' + +target 'WikipediaUnitTests', :exclusive => false do + pod 'OCMockito', '~> 1.4' + pod 'OCHamcrest', '~> 4.1' +end diff --git a/samples/Ruby/filenames/Snapfile b/samples/Ruby/filenames/Snapfile new file mode 100644 index 00000000..182c7d1f --- /dev/null +++ b/samples/Ruby/filenames/Snapfile @@ -0,0 +1,26 @@ + +# Download the latest screenshot information from the CMS +app_id = Dir.pwd.split("/")[-2].to_i +File.write("./screenshots.json", open("https://...amazonaws.com/1.0/#{app_id}/....json").read) rescue nil + + +# A list of devices you want to take the screenshots from +devices([ + "iPhone 6", + "iPhone 6 Plus", + "iPhone 5", + "iPhone 4s" +]) + +languages([ + 'de-DE' +]) + +# Where should the resulting screenshots be stored? +screenshots_path "./screenshots" + +# JavaScript UIAutomation file +js_file './snapshot.js' + +# The name of the project's scheme +scheme 'Release' \ No newline at end of file