reactnative
Bitrise

bitriseでreact nativeをビルドする時のworkflow設定

bitriseでreact nativeアプリのciを回してapkを配布する時workflowの設定をメモしておきます。

androidの場合

  deploy-android:
    steps:
    - activate-ssh-key@3.1.1:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone@4.0.11: {}
    - install-react-native@0.9.1: {}
    - yarn@0.0.7:
        inputs:
        - args: "--network-timeout 100000"
        - command: setup
        title: yarn setup
    - yarn@0.0.7:
        inputs:
        - command: test
        title: yarn test
    - react-native-bundle@1.0.3:
        inputs:
        - entry_file: index.js
        - dev: 'false'
        - platform: android
        - out: "$BITRISE_DEPLOY_DIR/android/app/src/main/assets/index.android.bundle"
        - assetRoots: "$BITRISE_SOURCE_DIR/android/app/src/main/res/"
    - gradle-runner@1.8.3:
        inputs:
        - gradle_task: assembleRelease
    - sign-apk@1.2.0: {}
    - deploy-to-bitrise-io@1.3.11:
        inputs:
        - notify_user_groups: admins
        - deploy_path: "$BITRISE_DEPLOY_DIR/app-release-bitrise-signed.apk"
        - is_enable_public_page: 'false'

iosの場合

  deploy-ios:
    steps:
    - activate-ssh-key@3.1.1:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone@4.0.11: {}
    - yarn@0.0.7:
        inputs:
        - command: setup
        title: yarn setup
    - yarn@0.0.7:
        inputs:
        - command: test
        title: yarn test
    - install-react-native@0.9.1: {}
    - ios-auto-provision@1.1.0:
        inputs:
        - scheme: {your scheme name}
        - team_id: {your team id}
    - xcode-archive@2.4.8:
        inputs:
        - force_team_id: {your team id}
        - force_code_sign_identity: iPhone Developer
        - scheme: {your scheme name}
    - deploy-to-bitrise-io@1.3.11:
        inputs:
        - is_enable_public_page: 'false'
        - notify_user_groups: none

ios-auto-provisionマジ神! xcodeの方はAutomatically manage signingを使っているのでCertificate and profile installerで結構はまりました。