@lamantin/fastpush
Typed fastlane frontend for pushing builds to store
Last updated 3 months ago by lamantin .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @lamantin/fastpush 
SYNC missed versions from official npm registry.

fastpush codecov tests api

Typed fastlane frontend for pushing builds to store

What is it

fastpush - it is frontend for fastlane.tools, that can offer to you next solved fastlane problems:

  • Use JavaScript and TypeScript for build process
  • Types and autocomplete for your actions and lanes
  • Use single file for both platform without switching between them

Usage

Write your own file that hold logic of build process

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

async function distribute() {
  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" }),
  ])
}

distribute()

Run it via ts-node distribute.ts

Need more? Check Example part for more complicated cases

Setup

  1. Prepare environment needed for fastlane iOS and/or Android platforms
  2. Install this publish library with preferred package manager
    yarn add @lamantin/fastpush --dev
    or
    npm install @lamantin/fastpush --save-dev
  3. Go to Usage and write your own build process

Example

CLI

Library distributed with fastpush CLI tool, which helpful for distribute your app with 0 line of additional code.

You can invoke it with you package manager like:
yarn fastpush --help

  fastpush - helper for publishing react-native projects via fastlane

  USAGE

    fastpush [android] [ios] --track <alpha|beta|production> [...options]

  PARAMETERS

    android - publish android to Google Play
    ios     - publish ios to AppStore       

  OPTIONS

    -i, --increment <none|patch|minor|major> - increment app version [none]     
    -t, --track <alpha|beta|production>      - select publish track [alpha]     
    -s, --silent <true|false>                - distribute without asking [false]
    -p, --project <project>                  - path to root of project [.]      
    -r, --rollout <0..100>                   - percent rollout [100]            

This tool contains all best-practice for publishing app For more complicated examples, you can check implementation of CLI tool at src/cli/publish.ts that distributed with this library

Hooks for build process

Since most of the app distribution logic changes very rarely (but aptly), we have added hook functionality that allows you to change the distribution behavior at any stage of execution.

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'

// fastpush - function that map CLI arguments to `options` object with parameters
const options: FastpushResult = fastpush(process.argv)

// publish - function that can process object and distibute app with no effort.
publish(options, {
  // onPostPublish - hook that invoked each time, when app successfuly distibuted
  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}`
    sendMessage(message)    
  }
})

Exist some types of hooks:

  • onStart - hook that invoked first, before others hooks and before starting operations. Invoked 1 time.
  • onPostPublish - hook you can do something usefull, when app is distibuted. Add git tag or send message to team and etc. Can be invoked multiple times (if you distribute to Android and iOS together) or 0 if build not published.
  • onFinish - hook that invoked at end of all build process. Useful for aggregate information about build process and make analytics. Invoked 1 time.

Write your own build script

As described at Usage part, you can write your own implementation of build process from scratch. For inspiration you can check our implementation here.

If you do not want to use the build process written by us, but you want to quickly get a list of arguments as JS object, you can use our CLI parser named fastpush directly from code

import { fastpush, FastpushOptions } from '@lamantin/fastpush/build/src/cli/fastpush'

const options: FastpushOptions = fastpush(process.argv)
console.log("Parsed options:", options)

// options that you can get
// {
//     increment: "none" | "patch" | "minor" | "major";
//     track: "production" | "beta" | "alpha";
//     silent: boolean;
//     project: string;
//     rollout: number;
//     env: string;
//     flavor: string;
//     build: "bundle" | "assemble";
//     android: boolean;
//     ios: boolean;
// };

Roadmap

  • [x] Typing for build and publish lanes
  • [ ] Typings to other actions and lanes
  • [ ] Use semver notation.
    For now, library api in experimental status and it can be changed without semver version updates.
  • [x] IOSPlatform helper for increment build number, set version name and getting this values
  • [x] AndroidPlatform helper for increment build number, set version name and getting this values
  • [x] CLI tool fastpush for possibility publish build without writing any line of code
  • [x] Hooks for build process support
  • [ ] Use DI for providing implementation of some build process, like up versioning, tagging and etc.

Current Tags

  • 0.0.47                                ...           latest (3 months ago)

45 Versions

  • 0.0.47                                ...           3 months ago
  • 0.0.46                                ...           3 months ago
  • 0.0.45                                ...           3 months ago
  • 0.0.43                                ...           3 months ago
  • 0.0.42                                ...           3 months ago
  • 0.0.41                                ...           3 months ago
  • 0.0.40                                ...           3 months ago
  • 0.0.39                                ...           3 months ago
  • 0.0.38                                ...           3 months ago
  • 0.0.37                                ...           3 months ago
  • 0.0.36                                ...           3 months ago
  • 0.0.35                                ...           3 months ago
  • 0.0.34                                ...           3 months ago
  • 0.0.33                                ...           3 months ago
  • 0.0.32                                ...           3 months ago
  • 0.0.31                                ...           3 months ago
  • 0.0.30                                ...           3 months ago
  • 0.0.29                                ...           3 months ago
  • 0.0.28                                ...           3 months ago
  • 0.0.27                                ...           3 months ago
  • 0.0.26                                ...           3 months ago
  • 0.0.25                                ...           3 months ago
  • 0.0.24                                ...           3 months ago
  • 0.0.23                                ...           3 months ago
  • 0.0.22                                ...           3 months ago
  • 0.0.21                                ...           3 months ago
  • 0.0.20                                ...           3 months ago
  • 0.0.19                                ...           3 months ago
  • 0.0.18                                ...           3 months ago
  • 0.0.17                                ...           3 months ago
  • 0.0.16                                ...           3 months ago
  • 0.0.15                                ...           3 months ago
  • 0.0.14                                ...           3 months ago
  • 0.0.13                                ...           3 months ago
  • 0.0.12                                ...           3 months ago
  • 0.0.11                                ...           3 months ago
  • 0.0.10                                ...           3 months ago
  • 0.0.9                                ...           3 months ago
  • 0.0.8                                ...           3 months ago
  • 0.0.7                                ...           3 months ago
  • 0.0.6                                ...           3 months ago
  • 0.0.5                                ...           3 months ago
  • 0.0.4                                ...           3 months ago
  • 0.0.3                                ...           3 months ago
  • 0.0.1                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (11)
Dev Dependencies (24)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |