wgb1234

打包脚本集成

  1. 定义好可配置项,方便修改
# 先定义好全局变量 
SCHEME = "xxx"
WORKSPACE = "xxx.xcworkspace"
XCODEPROJ = "xxx.xcodeproj"
BundleId = "com.xxx.ooo"
dingding_token = "xxxxoooo" #电脑端钉钉建群群助手添加机器人webhook设置好获取token即可 发消息得带tag不然可能失败

  1. 打包到Testflight

    desc "打包到Testflight"
      lane :beta do
        increment_build_number_in_plist(target: SCHEME) #build号自增
        build_app(
          workspace: WORKSPACE,
          scheme: SCHEME,
          silent: true,
          clean: true,
          output_directory: \'.ipa/Testflight\',
          output_name: \'app.ipa\',
          export_xcargs: "-allowProvisioningUpdates",
          export_options: {
            method: \'app-store\',
            manifest: {
              appURL: \'https://example.com/MyApp.ipa\',
              displayImageURL: \'http://xxxxxx\',#小图标
              fullSizeImageURL: \'http://xxxxx\'#大图标1024x1024
            }
          }
        )
        upload_to_testflight(
          ipa: \'.ipa/Testflight/app.ipa\'
        )
     end
    
  2. 打包到App Store

    desc "部署到App Store"
      lane :release do |options|
        sigh(
          output_path: \'.certificates\',
          force: true
        )
    
        increment_version_number_in_plist(
          target: SCHEME,
          version_number: options[:version_number]
        )
        increment_build_number_in_plist(target: SCHEME)
    
        gym(
          scheme: SCHEME,
          clean: true,
          silent: true,
          output_directory: \'.ipa/AppStore\',
          output_name: \'app.ipa\',
          configuration: \'Release\',
          export_xcargs: "-allowProvisioningUpdates"
        )
        upload_to_app_store(
          force: true,
          ipa: \'.ipa/AppStore/app.ipa\',
          skip_screenshots: true,
          automatic_release: true
        )
      end
    
  3. 打AdHoc分发包

    cert #获取证书
    #验证签名
    sigh(
      adhoc: true,
      output_path: \'.certificates\',
      app_identifier: BundleId
     )
    #自增build号
    increment_build_number_in_plist(target: SCHEME)
    time = Time.now.strftime("%Y-%m-%d %H:%M:%S")
    #编译打包
    gym(
      scheme: SCHEME,
      clean: true,
      output_directory: ".ipa/#{SCHEME}/#{time}",
      output_name: \'app.ipa\',
      configuration: "Release",
      export_xcargs: "-allowProvisioningUpdates"
     )
    # 上传蒲公英 
    upload_ipa_to_pgyer(scheme: SCHEME, time: time)
    
    # 发送钉钉消息
    send_dingding_msg()
    
  4. 上传至蒲公英分发平台 (这个平时用的比较多)

    private_lane :upload_ipa_to_pgyer do |options|
        pgyer(
          api_key: "xxxxx",
          user_key: "xxxxx",
          ipa: ".ipa/#{options[:scheme]}/#{options[:time]}/app.ipa"
        )
     end
    
  5. 发送钉钉机器人消息

      desc "发送机器人

分类:

技术点:

相关文章:

  • 2021-10-27
  • 2021-10-03
  • 2021-12-11
  • 2021-11-05
  • 2021-11-04
  • 2021-08-14
  • 2021-10-17
  • 2021-04-29
猜你喜欢
  • 2019-10-11
  • 2021-12-30
  • 2021-12-09
  • 2021-09-13
  • 2021-10-16
  • 2021-11-09
  • 2019-08-23
相关资源
相似解决方案