Skip to content

Instantly share code, notes, and snippets.

@mmiedlarz
Last active September 6, 2020 18:27
Show Gist options
  • Save mmiedlarz/7d5485addbade0616b4d652de2fdd641 to your computer and use it in GitHub Desktop.
Save mmiedlarz/7d5485addbade0616b4d652de2fdd641 to your computer and use it in GitHub Desktop.
Final version of Fastfile and Matchfile
platform :ios do
desc "Recreate provisioning profiles and certificates."
lane :recreate_certificates do
match(type: "development", force_for_new_devices: true)
match(type: "adhoc", force_for_new_devices: true)
match(type: "appstore")
end
desc "Fetch certificates and provisioning profiles from git repo"
lane :fetch_certificates do
match(type: "development", readonly: true)
match(type: "adhoc", readonly: true)
match(type: "appstore", readonly: true)
end
desc "Archives the app and upload new build to the AppCenter"
lane :build_adhoc do
cocoapods(try_repo_update_on_error: true)
scan(
workspace: "./MyProject.xcworkspace",
scheme: "MyScheme",
configuration: "Debug",
devices: ["iPhone X"],
clean: true,
)
update_build_number
match(type: "adhoc", readonly: true)
gym(
include_bitcode: false,
clean: true,
workspace: "./MyProject.workspace",
scheme: "MyScheme",
output_name: "MyApp.ipa",
export_method: "ad-hoc"
)
# Binary upload using AppCenter
commit = last_git_commit
appcenter_upload(
api_token: "APP_CENTER_API_TOKEN",
owner_name: "APP_CENTER_OWNER_NAME",
app_name: "APP_CENTER_APP_NAME",
destinations: "AppTesters",
file: "./MyApp.ipa",
release_notes: commit[:message]
)
end
desc "Set build number based on current time"
private_lane :update_build_number do
build_number = Time.new.strftime("%Y.%m.%d.%H%M")
increment_build_number(
build_number: build_number,
xcodeproj: "./MyProject.xcodeproj"
)
end
end
git_url("git@githosting.com:match_provisioning_repo.git")
storage_mode("git")
type("development")
team_id("YOUR_APPLE_TEAM_ID")
app_identifier(["com.your.appId1", "com.your.appId2"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment