美文网首页
fastlane的应用

fastlane的应用

作者: 太平洋_cfd2 | 来源:发表于2022-08-01 09:30 被阅读0次

    https://juejin.cn/post/7008553785672859656

    https://juejin.cn/post/6844904205489012744

    https://wangguibin.github.io/hexo-github-action/2020/11/25/Fastlane%E8%87%AA%E5%8A%A8%E5%8C%96%E8%84%9A%E6%9C%AC%E6%89%93%E5%8C%85%E4%B8%8A%E4%BC%A0%E8%92%B2%E5%85%AC%E8%8B%B1%E5%8F%91%E9%80%81%E9%92%89%E9%92%89%E6%9C%BA%E5%99%A8%E4%BA%BA%E6%B6%88%E6%81%AF%E9%80%9A%E7%9F%A5/

    # This file contains the fastlane.tools configuration
    # You can find the documentation at https://docs.fastlane.tools
    #
    # For a list of all available actions, check out
    #
    #     https://docs.fastlane.tools/actions
    #
    # For a list of all available plugins, check out
    #
    #     https://docs.fastlane.tools/plugins/available-plugins
    #
    
    # Uncomment the line if you want fastlane to automatically update itself
    # update_fastlane
    
    default_platform(:ios)
    
    platform :ios do
      desc "Description of what the lane does"
      lane :push do
            # add actions here: https://docs.fastlane.tools/actions
    
        gym(
              clean: true,
              silent: true,
              export_method: 'ad-hoc',
              output_directory: './fastlane/build',
              output_name:"customer.ipa",
              scheme: 'Customer',
              configuration: 'Release',
              ###########
              # sdk:"iOS 12.0",
              # archive_path:"./fastlane/Archive",
              include_symbols:true,
              export_xcargs: "-allowProvisioningUpdates",
        )
    
        updateVersionDes = "OS包用户端更新"
    
        pgyer(
            api_key: "xxx", 
            user_key: "xxx",
            update_description: updateVersionDes
        )
    
      end
    end
    
    

    上传至appstore:
    https://juejin.cn/post/7068583210229170212
    /// 上传到指定的team
    https://juejin.cn/post/6844903495200407560
    /// 更多的fastlane参数
    https://existorlive.github.io/2020/12/17/Fastlane.html

    desc "以 app-store 方式打包并上传到 iTunes Connect"
      lane :release do
    
        puts "自动生成 Provisioning Profiles 文件"
    
        puts "以 app-store 方式打包"
    
        gym(
          # 指定打包所使用的输出方式 (可选: app-store, package, ad-hoc, enterprise, development)
          export_method: "app-store",
          # 指定项目的 scheme 名称
          scheme: "DriverEn",
          # 指定输出的文件夹地址
          output_directory: './fastlane/build',
        output_name:"driver.ipa",
          # 指定打包方式 (可选: Release, Debug)
          configuration: "Release",
        export_xcargs: "-allowProvisioningUpdates"
        )
    
        puts "上传 ipa 包到 TestFlight"
        pilot(team_name: "QWQER  LLC")
    
        #puts "上传 ipa 包到 iTunes Connect"
        #deliver(
          # 跳过截图上传
          #skip_screenshots: true,
          # 跳过元数据上传
          #skip_metadata: true,
          # 跳过审核直接上传
          #force: true
        #)
    
      end
    
      end
    
    上传到钉钉机器人中的消息
    # This file contains the fastlane.tools configuration
    # You can find the documentation at https://docs.fastlane.tools
    #
    # For a list of all available actions, check out
    #
    #     https://docs.fastlane.tools/actions
    #
    # For a list of all available plugins, check out
    #
    #     https://docs.fastlane.tools/plugins/available-plugins
    #
    
    # Uncomment the line if you want fastlane to automatically update itself
    # update_fastlane
    
    default_platform(:ios)
    
    platform :ios do
      desc "Description of what the lane does"
      lane :push do
            # add actions here: https://docs.fastlane.tools/actions
    
        gym(
              clean: true,
              silent: true,
              export_method: 'ad-hoc',
              output_directory: './fastlane/build',
              output_name:"customer.ipa",
              scheme: 'Customer',
              configuration: 'Release',
              ###########
              # sdk:"iOS 12.0",
              # archive_path:"./fastlane/Archive",
              include_symbols:true,
              export_xcargs: "-allowProvisioningUpdates",
        )
    
        updateVersionDes = "@周美婵(Coco) @高伟隆(Lorentz) @许丹(许丹) @许听(许听) iOS包用户端更新"
    
        pgyer(
            api_key: "606c5b6de8a2ac76aeeea7532a61c789", 
            user_key: "2a4ce2b21570f022514896320716280c",
            update_description: updateVersionDes
        )
     
         # 钉钉机器人
        app_patch = "build/driver.ipa"
        app_version = "1.0.0"
        app_build_version = "1"
        app_name    = "博帅王子"
        app_url = "https://www.pgyer.com/s2iU"
    
        dingTalk_url = "https://oapi.dingtalk.com/robot/send?access_token=c9f1a24d7d82be81dcbe2a457e4f2e6a3ccc47fa5a3cecbda249a1dbc82d2e5a"
    
        # 构造消息格式
        actionCard =
        {
        "markdown": {
            "title": "iOS 内测版",
            "text": " # iOS国外物流配送端 \n # 无敌没bug版  更新了
          \n\n \n\n [@13430797822](#{app_url})\n [@15875515950](#{app_url})\n [@17580959503](#{app_url})\n [@15112588418](#{app_url})\n [@13823725437](#{app_url})\n
        ![](https://www.pgyer.com/app/qrcode/s2iU) \n\n",
        },
        "at": {
            "atMobiles": [
                "13430797822",
                "15875515950",
                "17580959503",
            
                #"15112588418",
                #"13823725437"
            ],
            "isAtAll": false
        },
        "msgtype": "markdown"
        }
    
        puts "发送的钉钉消息:#{actionCard} "
    
        uri = URI.parse(dingTalk_url)
        https = Net::HTTP.new(uri.host, uri.port)
        https.use_ssl = true
    
        request = Net::HTTP::Post.new(uri.request_uri)
        request.add_field('Content-Type', 'application/json')
        request.body = actionCard.to_json
    
        response = https.request(request)
    
      end
    
      desc "以 app-store 方式打包并上传到 iTunes Connect"
      lane :release do
    
        puts "自动生成 Provisioning Profiles 文件"
    
        puts "以 app-store 方式打包"
    
        gym(
          # 指定打包所使用的输出方式 (可选: app-store, package, ad-hoc, enterprise, development)
          export_method: "app-store",
          # 指定项目的 scheme 名称
          scheme: "Customer",
          # 指定输出的文件夹地址
          output_directory: './fastlane/build',
        output_name:"driver.ipa",
          # 指定打包方式 (可选: Release, Debug)
          configuration: "Release",
        export_xcargs: "-allowProvisioningUpdates"
        )
    
        puts "上传 ipa 包到 TestFlight"
        pilot(team_name: "Shenzhen Kuai Feike Logistics Co., Ltd.")
    
        #puts "上传 ipa 包到 iTunes Connect"
        #deliver(
          # 跳过截图上传
          #skip_screenshots: true,
          # 跳过元数据上传
          #skip_metadata: true,
          # 跳过审核直接上传
          #force: true
        #)
    
      end
    
    
    end
    
    

    相关文章

      网友评论

          本文标题:fastlane的应用

          本文链接:https://www.haomeiwen.com/subject/kaalwrtx.html