Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiet480 committed Jan 7, 2017
1 parent ffea31d commit c513248
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -61,5 +61,5 @@ fastlane/screenshots

# scan temporary files
fastlane/test_output

fastlane/keys
env.sh
2 changes: 1 addition & 1 deletion HomeAssistant.xcodeproj/project.pbxproj
Expand Up @@ -1377,7 +1377,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Fabric/run\" af2930e95b69736a32e543d07fe9c8078649a61e d1e18a77ecf813c5a72de304e2eb0bf1c2afc6098612966ac15ef9f1589ff506";
shellScript = "[ -z \"$HOMEASSISTANT_FABRIC_CLIENT_ID\" ] && echo \"$HOMEASSISTANT_FABRIC_CLIENT_ID is not defined on your ENV\" && exit 0;\n [ -z \"$HOMEASSISTANT_FABRIC_SECRET\" ] && echo \"$HOMEASSISTANT_FABRIC_SECRET is not defined on your ENV\" && exit 0;\n \"${PODS_ROOT}/Fabric/run\" ${HOMEASSISTANT_FABRIC_CLIENT_ID} ${HOMEASSISTANT_FABRIC_SECRET}";
};
C1A731CE521F4B94A0023EB2 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
2 changes: 1 addition & 1 deletion HomeAssistant/Info.plist
Expand Up @@ -36,7 +36,7 @@
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>af2930e95b69736a32e543d07fe9c8078649a61e</string>
<string>${HOMEASSISTANT_FABRIC_CLIENT_ID}</string>
<key>Kits</key>
<array>
<dict>
Expand Down
7 changes: 2 additions & 5 deletions fastlane/Appfile
@@ -1,7 +1,4 @@
apple_id "me@robbiet.us"
app_identifier "io.robbie.HomeAssistant" # The bundle identifier of your app

team_id "UTQFCBPQRF" # Developer Portal Team ID

# 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
apple_id ENV["HOMEASSISTANT_APPLE_ID"]
team_id ENV["HOMEASSISTANT_TEAM_ID"] # Developer Portal Team ID
12 changes: 3 additions & 9 deletions fastlane/Deliverfile
@@ -1,9 +1,3 @@
###################### More Options ######################
# If you want to have even more control, check out the documentation
# https://github.com/fastlane/fastlane/blob/master/deliver/Deliverfile.md


###################### Automatically generated ######################
# Feel free to remove the following line if you use fastlane (which you should)

app_identifier "io.robbie.HomeAssistant" # The bundle identifier of your app
app_identifier "io.robbie.HomeAssistant"
username ENV["HOMEASSISTANT_APPLE_ID"]
automatic_release false
95 changes: 69 additions & 26 deletions fastlane/Fastfile
Expand Up @@ -18,16 +18,38 @@ default_platform :ios
platform :ios do
before_all do
# cocoapods
ENV["DELIVER_USERNAME"] = ENV["HOMEASSISTANT_APPLE_ID"]
ENV["MATCH_PASSWORD"] = ENV["HOMEASSISTANT_CERTIFICATE_KEY"]
ENV["PILOT_APPLE_ID"] = ENV["HOMEASSISTANT_APPLE_ID"]
ENV["SIGH_USERNAME"] = ENV["HOMEASSISTANT_APPLE_ID"]
end

desc "Fetches the provisioning profiles so you can build locally and deploy to your device"
lane :certs do
match(app_identifier: "io.robbie.HomeAssistant", type: "development")
match(app_identifier: "io.robbie.HomeAssistant.APNSAttachmentService", type: "development")
match(app_identifier: "io.robbie.HomeAssistant.NotificationContentExtension", type: "development")
match(app_identifier: "io.robbie.HomeAssistant", type: "appstore")
match(app_identifier: "io.robbie.HomeAssistant.APNSAttachmentService", type: "appstore")
match(app_identifier: "io.robbie.HomeAssistant.NotificationContentExtension", type: "appstore")
match(
app_identifier: "io.robbie.HomeAssistant",
type: "development"
)
match(
app_identifier: "io.robbie.HomeAssistant.APNSAttachmentService",
type: "development"
)
match(
app_identifier: "io.robbie.HomeAssistant.NotificationContentExtension",
type: "development"
)
match(
app_identifier: "io.robbie.HomeAssistant",
type: "appstore"
)
match(
app_identifier: "io.robbie.HomeAssistant.APNSAttachmentService",
type: "appstore"
)
match(
app_identifier: "io.robbie.HomeAssistant.NotificationContentExtension",
type: "appstore"
)
end

def change_log_since_last_tag
Expand All @@ -44,23 +66,13 @@ platform :ios do
"#{build_type}/#{version_number}/#{build_number}"
end

def load_keys
begin
import("keys")
rescue => exception
UI.error("fastlane/keys file not found. To use this Fastfile, copy fastlane/keys.template into fastlane/keys and fill in the values")
raise exception
end
end

private_lane :verify_xcode_version do
ensure_xcode_version(version: REQUIRED_XCODE_VERSION)
end

desc "Submit a new Beta Build to Apple TestFlight"
desc "This will also make sure the profile is up to date"
lane :go_testflight do |options|
load_keys

ensure_git_branch(
branch: "(master|release\\S+|hotfix\\S+)"
Expand All @@ -70,7 +82,7 @@ platform :ios do

git_pull

#verify_xcode_version
verify_xcode_version

version_number = options[:version_number] || get_version_number

Expand All @@ -86,9 +98,19 @@ platform :ios do
clean_build_artifacts
clear_derived_data

match(app_identifier: "io.robbie.HomeAssistant", readonly: true)
match(app_identifier: "io.robbie.HomeAssistant.APNSAttachmentService", readonly: true)
match(app_identifier: "io.robbie.HomeAssistant.NotificationContentExtension", readonly: true)
match(
app_identifier: "io.robbie.HomeAssistant",
readonly: true
)
match(
app_identifier: "io.robbie.HomeAssistant.APNSAttachmentService",
readonly: true
)
match(
app_identifier: "io.robbie.HomeAssistant.NotificationContentExtension",
readonly: true
)

gym(
workspace: "HomeAssistant.xcworkspace",
scheme: "HomeAssistant",
Expand All @@ -97,15 +119,25 @@ platform :ios do
output_directory: "./build"
)

notification(subtitle: "Finished Building", message: "Uploading to Testflight", activate: "com.googlecode.iterm2", app_icon:"https://raw.githubusercontent.com/fastlane/fastlane/master/fastlane/assets/fastlane.png")
notification(
subtitle: "Finished Building",
message: "Uploading to Testflight",
activate: "com.googlecode.iterm2",
app_icon:"https://raw.githubusercontent.com/fastlane/fastlane/master/fastlane/assets/fastlane.png"
)

pilot(
changelog: change_log,
skip_submission: true,
distribute_external: false
)

notification(subtitle: "Finished Uploading", message: "Upload complete. Committing version bump and pushing to Git", activate: "com.googlecode.iterm2", app_icon:"https://raw.githubusercontent.com/fastlane/fastlane/master/fastlane/assets/fastlane.png")
notification(
subtitle: "Finished Uploading",
message: "Upload complete. Committing version bump and pushing to Git",
activate: "com.googlecode.iterm2",
app_icon:"https://raw.githubusercontent.com/fastlane/fastlane/master/fastlane/assets/fastlane.png"
)

commit_version_bump(
message: "Version bump to #{complete_version_number}",
Expand All @@ -116,14 +148,19 @@ platform :ios do

set_github_release(
repository_name: "home-assistant/home-assistant-iOS",
api_token: ENV["GITHUB_API_TOKEN"],
api_token: ENV["HOMEASSISTANT_GITHUB_API_TOKEN"],
name: complete_version_number,
tag_name: tag_name("testflight", version_number, build_number),
description: change_log || "Release commit",
is_prerelease: false
)

notification(subtitle: "Finished", message: "Build #{complete_version_number} built and uploaded to Testflight", activate: "com.googlecode.iterm2", app_icon:"https://raw.githubusercontent.com/fastlane/fastlane/master/fastlane/assets/fastlane.png")
notification(
subtitle: "Finished",
message: "Build #{complete_version_number} built and uploaded to Testflight",
activate: "com.googlecode.iterm2",
app_icon:"https://raw.githubusercontent.com/fastlane/fastlane/master/fastlane/assets/fastlane.png"
)

rocket
end
Expand All @@ -132,9 +169,15 @@ platform :ios do
lane :go_appstore do
increment_build_number
commit_version_bump
match(type: "appstore")
match(
type: "appstore"
)
# snapshot
gym(scheme: "HomeAssistant", workspace: "HomeAssistant.xcworkspace", output_directory: "./build") # Build your app - more options available
gym(
scheme: "HomeAssistant",
workspace: "HomeAssistant.xcworkspace",
output_directory: "./build"
) # Build your app - more options available
deliver(force: true)
# frameit
end
Expand Down
4 changes: 2 additions & 2 deletions fastlane/Matchfile
@@ -1,9 +1,9 @@
git_url "https://github.com/home-assistant/ios-certificates"
git_url ENV["HOMEASSISTANT_CERTIFICATE_GIT"]

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

app_identifier "io.robbie.HomeAssistant"
username "me@robbiet.us" # Your Apple Developer Portal username
username ENV["HOMEASSISTANT_APPLE_ID"] # Your Apple Developer Portal username

# For all available options run `match --help`
# Remove the # in the beginning of the line to enable the other options
6 changes: 3 additions & 3 deletions fastlane/keys.template
@@ -1,5 +1,5 @@
ENV["GITHUB_API_TOKEN"] = ""
ENV["APPLE_ID"] = ""
ENV["SIGH_USERNAME"] = ENV["APPLE_ID"]
ENV["PILOT_APPLE_ID"] = ENV["APPLE_ID"]
ENV["DELIVER_USERNAME"] = ENV["APPLE_ID"]
ENV["SIGH_USERNAME"] = ENV["HOMEASSISTANT_APPLE_ID"]
ENV["PILOT_APPLE_ID"] = ENV["HOMEASSISTANT_APPLE_ID"]
ENV["DELIVER_USERNAME"] = ENV["HOMEASSISTANT_APPLE_ID"]

0 comments on commit c513248

Please sign in to comment.