رد فعل الأصدقاء الأصلي و Fastlane

https://habrastorage.org/webt/n8/lo/r5/n8lor5lkvnqev0xktqwxayrv1t0.png


لقد صادف أولئك منكم الذين كانوا مهتمين بموضوع مماثل مرة واحدة على الأقل Fastlane أكثر من مرة - وهي أداة مفيدة للغاية تحل مشكلة أتمتة الإنشاءات ونشر التطبيقات.


هناك عدد كبير من المقالات ومقاطع الفيديو التي تصف بالتفصيل ميزة استخدام التجميع الآلي للمشروع ومحتويات هذه المقالات فيما يتعلق بـ React Native (ومع ذلك ، إلى منصة مشتركة أخرى) يتم تقليلها إلى الإجراءات التالية:


  1. تهيئة Fastlane في مجلدات iOS و Android
  2. انسخ أنواع البرامج النصية الخاصة بالمنصة: clean، build،publish
  3. iOS Android
  4. !

, , - . ,


  1. ?
    , ( , , ..). Fastfile , DRY?
  2. ?
    Ruby, Fastlane , Fastlane . JS , Ruby, , , .
  3. ?
    , , , Android. iOS Fastlane , Android . Ruby , Ruby , , .
  4. ?
    . , - , .

- Ruby API, . Android :


#      
import "../../scripts/Fastfile.rb"

lane :publish do |options|
  #       
  self.runner.current_platform = :android

  assert_git()
  assert_environment(env: options[:env])
  assert_credentials()

  new_version=increment_version(type: options[:increment])
  version_description=set_version(version: new_version)

  build(env: options[:env])

  upload(track: options[:track])

  commit(text: 'Up version to ' + new_version)
  commit_tag(text: 'android/' + new_version)
  push_all()

  message(text: '   "'+ app_name + '"   Google Play.   ' + options[:track].upcase + ' ' + version_description + url)
end

, build, Fastfile.rb. - : .


Ruby, , . React Native JS , , , Ruby. JS ! ( )


(, ) Fastlane, JS, . :


https://habrastorage.org/webt/vq/bi/pp/vqbippe_pkcckg5utfsdseb948a.gif


, .


:


import { android, gradle, AndroidPlatform, ui, supply, Incrementer } from "@lamantin/fastpush"

const androidPlatform = new AndroidPlatform()

const [oldVersionCode, newVersionCode] = await androidPlatform.incrementVersionCode()
ui.success(`Success update build [${oldVersionCode}] -> [${newVersionCode}]`)

android([
  gradle("clean"),
  gradle("assemble", {
    build_type: "Release",
  }),
  supply({ track: "beta" }),
])

( ), :


  • TypeScript ,
  • JS
  • , ,
  • 1 , . ios android Fastlane
  • ,

, , . , CLI , , :


https://habrastorage.org/webt/mf/2q/yy/mf2qyyzncnmxlbijlkctcl8lzwu.png


Github , .




yarn add @lamantin/fastpush --dev
# 
npm install @lamantin/fastpush --save-dev

, , - :


import { publish } from '@lamantin/fastpush/build/src/cli/publish'
import { fastpush, FastpushResult } from '@lamantin/fastpush/build/src/cli/fastpush'
import { git } from '@lamantin/fastpush/build/src/utils'
import Telegram from 'our-own-app/Telegram'

//    
const options: FastpushResult = fastpush(process.argv)

//     (   CLI),     
publish(options, {
  // onPostPublish - ,       
  onPostPublish: async (platform, [prevVersion, version], [prevBuild, build]) => {
    const store = platform.type === 'ios' ? 'App Store ' : 'Google Play '
    const message = `App "My App Name"  sended to ${store}, track ${options.track.toUpperCase()}.\\n Version: ${tag}`
    Telegram.sendMessage(message)    
  }
})

fastpush, , JS options, . , publish . , ( , ).


Flutter?


React Native, Flutter ( ).




المشروع قيد الإنجاز الفعال ويرحب بطلبات السحب أو المشاكل أو على الأقل التعليقات.
نأمل أن يكون ذلك مفيدًا لشخص آخر غيرنا أو يشجعنا على كتابة حلول أكثر مرونة.


All Articles