Fastfile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # This file contains the fastlane.tools configuration
  2. # You can find the documentation at https://docs.fastlane.tools
  3. #
  4. # For a list of all available actions, check out
  5. #
  6. # https://docs.fastlane.tools/actions
  7. #
  8. # For a list of all available plugins, check out
  9. #
  10. # https://docs.fastlane.tools/plugins/available-plugins
  11. #
  12. # Uncomment the line if you want fastlane to automatically update itself
  13. # update_fastlane
  14. #超时时间和重复次数
  15. ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "600"
  16. ENV["FASTLANE_XCODEBUILD_SETTINGS_RETRIES"] = "3"
  17. default_platform(:ios)
  18. platform :ios do
  19. # before_all do
  20. # ENV["FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD"] = "applepsd4other"
  21. # # ENV["FASTLANE_SESSION"] = '生成的session cookie'
  22. # end
  23. desc "测试环境入口"
  24. lane :dev_build do
  25. # add actions here: https://docs.fastlane.tools/actions
  26. # # build 号加1
  27. # increment_build_number_in_plist(
  28. # target: "xxx"
  29. # )
  30. # git_commit(path:".", message:"Bump build to #{build_number}")
  31. # 清理构建目录
  32. # clean_build_artifacts
  33. # 安装依赖
  34. # cocoapods
  35. #获取时间格式
  36. time = Time.new.strftime("%Y%m%d%H%M")
  37. version = get_version_number#获取版本号
  38. ipaName = "huiguanjia_dev_#{version}_#{time}.ipa"
  39. # 构建应用
  40. gym(
  41. scheme:"dev", #项目名称
  42. export_method:"development",#打包的类型
  43. configuration:"Release",#模式,默认Release,还有Debug
  44. # clean: true,
  45. # clean: clean_build,
  46. output_name:"#{ipaName}",#输出的包名
  47. output_directory:"./fastlane_build"#输出的位置
  48. )
  49. # 上传版本到蒲公英平台
  50. pgyer(
  51. api_key: "237ccf1bb80c529471c732ea01035876",
  52. # user_key: "31c85d64720d80fc91b3b551d5b3d1e0",
  53. )
  54. end
  55. desc "生产环境入口"
  56. lane :release_build do
  57. # 清理构建目录
  58. clean_build_artifacts
  59. # 安装依赖
  60. cocoapods
  61. #获取时间格式
  62. time = Time.new.strftime("%Y%m%d%H%M")
  63. version = get_version_number#获取版本号
  64. ipaName = "huiguanjia_build_#{version}_#{time}.ipa"
  65. # 构建应用
  66. gym(
  67. scheme:"prod", #项目名称
  68. export_method:"app-store",#打包的类型
  69. configuration:"Release",#模式,默认Release,还有Debug
  70. output_name:"#{ipaName}",#输出的包名
  71. output_directory:"./fastlane_build"#输出的位置
  72. )
  73. # 上传到TestFlight
  74. upload_to_testflight
  75. end
  76. end