Slide 1

Slide 1 text

Tips for Bitrise Android @shaunkawano

Slide 2

Slide 2 text

•How to setup Bitrise / Bitrise Steps •How to setup Fastlane •How to Manage bitrise.yml on Git Not Talking

Slide 3

Slide 3 text

?

Slide 4

Slide 4 text

•Push Commit→ Run Test → Lint → Distribute App through Crashlytics
 •Push Tag(GitHub Draft Release) → 
 Build ReleaseAPK → Upload APK Before

Slide 5

Slide 5 text

•Memory Shortage → Build Failure •Home-made shell script •For Slack notification •For code signing •For uploading APK to GitHub Release Problem

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

•Memory Shortage → Build Failure 
 •Home-made shell script • For Slack notification • For code signing • For uploading APK to GitHub Release

Slide 8

Slide 8 text

•Memory Shortage → ✅ NO MORE
 •Home-made shell script • For Slack notification • For code signing • For uploading APK to GitHub Release

Slide 9

Slide 9 text

•Memory Shortage → ✅ NO MORE
 •Home-made shell script • For Slack notification • For code signing • For uploading APK to GitHub Release

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

git clone bitrise.yml
 (bitrise.io) bitrise.yml
 (in-repository)

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Detecting tag triggered while managing bitrise.yml on your Git repository


Slide 14

Slide 14 text

bitrise.yml(on bitrise.io) trigger_map: - push_branch: "*" workflow: primary - pull_request_source_branch: "*" workflow: primary workflows: primary: steps: - [email protected]: {} - [email protected]: {} - [email protected]: inputs: - content: |- #!/bin/bash bitrise trigger "$BITRISE_GIT_BRANCH"

Slide 15

Slide 15 text

bitrise.yml(on bitrise.io) trigger_map: - tag: "*" workflow: primary - push_branch: "*" workflow: primary - pull_request_source_branch: "*" workflow: primary workflows: primary: steps: - [email protected]: {} - [email protected]: {} - [email protected]: inputs: - content: |- #!/bin/bash bitrise trigger "$BITRISE_GIT_BRANCH"

Slide 16

Slide 16 text

bitrise.yml(on bitrise.io) trigger_map: - tag: "*" workflow: primary - push_branch: "*" workflow: primary - pull_request_source_branch: "*" workflow: primary workflows: primary: steps: - [email protected]: {} - [email protected]: {} - [email protected]: inputs: - content: |- #!/bin/bash bitrise trigger "$BITRISE_GIT_BRANCH"

Slide 17

Slide 17 text

bitrise.yml(on bitrise.io) trigger_map: - tag: "*" workflow: primary - push_branch: "*" workflow: primary - pull_request_source_branch: "*" workflow: primary workflows: primary: steps: - [email protected]: {} - [email protected]: {} - [email protected]: inputs: - content: |- #!/bin/bash bitrise trigger "$BITRISE_GIT_BRANCH"

Slide 18

Slide 18 text

bitrise.yml(in repository) trigger_map: - tag: "*" workflow: draftRelease - push_branch: master workflow: beta - push_branch: "*" workflow: test - pull_request_target_branch: "*" workflow: danger workflows: beta: title: Distribute new StagingRelease APK as beta before_run: - _prepare steps: - [email protected]: inputs: - content: |- bundle exec fastlane beta

Slide 19

Slide 19 text

bitrise.yml(in repository) trigger_map: - tag: "*" workflow: draftRelease - push_branch: master workflow: beta - push_branch: "*" workflow: test - pull_request_target_branch: "*" workflow: danger workflows: beta: title: Distribute new StagingRelease APK as beta before_run: - _prepare steps: - [email protected]: inputs: - content: |- bundle exec fastlane beta ←EXPECT TO TRIGGER

Slide 20

Slide 20 text

bitrise.yml(in repository) trigger_map: - tag: "*" workflow: draftRelease - push_branch: master workflow: beta - push_branch: "*" workflow: test - pull_request_target_branch: "*" workflow: danger workflows: beta: title: Distribute new StagingRelease APK as beta before_run: - _prepare steps: - [email protected]: inputs: - content: |- bundle exec fastlane beta ←ACTUALLY TRIGGERS

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

bitrise.yml(on bitrise.io) trigger_map: - tag: "*" workflow: primary - push_branch: "*" workflow: primary - pull_request_source_branch: "*" workflow: primary workflows: primary: steps: - [email protected]: {} - [email protected]: {} - [email protected]: inputs: - content: |- #!/bin/bash bitrise trigger "$BITRISE_GIT_BRANCH"

Slide 23

Slide 23 text

bitrise.yml(on bitrise.io) trigger_map: - tag: "*" workflow: primary - push_branch: "*" workflow: primary - pull_request_source_branch: "*" workflow: primary workflows: primary: steps: - [email protected]: {} - [email protected]: {} - [email protected]: inputs: - content: |- #!/bin/bash bitrise trigger "$BITRISE_GIT_BRANCH"

Slide 24

Slide 24 text

$ bitrise help trigger

Slide 25

Slide 25 text

$ bitrise help trigger

Slide 26

Slide 26 text

bitrise.yml(on bitrise.io) trigger_map: - tag: "*" workflow: primary - push_branch: "*" workflow: primary - pull_request_source_branch: "*" workflow: primary workflows: primary: steps: - [email protected]: {} - [email protected]: {} - [email protected]: inputs: - content: |- #!/bin/bash bitrise trigger "$BITRISE_GIT_BRANCH"

Slide 27

Slide 27 text

bitrise.yml(on bitrise.io) trigger_map: - tag: "*" workflow: primary - push_branch: "*" workflow: primary - pull_request_source_branch: "*" workflow: primary workflows: primary: steps: - [email protected]: {} - [email protected]: {} - [email protected]: inputs: - content: |- #!/bin/bash bitrise trigger —-tag "$BITRISE_GIT_TAG"

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

e.g. When new tag is pushed, 
 1. Draft new release on GitHub
 2. Build releasing-application 3. Upload signed APK to the release

Slide 30

Slide 30 text

bitrise.yml(in repository) draftRelease: title: Add new draft release on GitHub before_run: - _prepare steps: - file-downloader: inputs: - source: "$BITRISEIO_ANDROID_KEYSTORE_URL" - destination: "$BITRISE_SOURCE_DIR/tapple-android.keystore" - file-downloader: inputs: - source: "$BITRISEIO_TAPPLE_ANDROID_GRADLE_URL" - destination: "$BITRISE_SOURCE_DIR/tapple-android.gradle" - [email protected]: inputs: - content: |- bundle exec fastlane draftRelease

Slide 31

Slide 31 text

bitrise.yml(in repository) draftRelease: title: Add new draft release on GitHub before_run: - _prepare steps: - file-downloader: inputs: - source: "$BITRISEIO_ANDROID_KEYSTORE_URL" - destination: "$BITRISE_SOURCE_DIR/tapple-android.keystore" - file-downloader: inputs: - source: "$BITRISEIO_TAPPLE_ANDROID_GRADLE_URL" - destination: "$BITRISE_SOURCE_DIR/tapple-android.gradle" - [email protected]: inputs: - content: |- bundle exec fastlane draftRelease

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

bitrise.yml(in repository) draftRelease: title: Add new draft release on GitHub before_run: - _prepare steps: - file-downloader: inputs: - source: "$BITRISEIO_ANDROID_KEYSTORE_URL" - destination: "$BITRISE_SOURCE_DIR/tapple-android.keystore" - file-downloader: inputs: - source: "$BITRISEIO_TAPPLE_ANDROID_GRADLE_URL" - destination: "$BITRISE_SOURCE_DIR/tapple-android.gradle" - [email protected]: inputs: - content: |- bundle exec fastlane draftRelease

Slide 34

Slide 34 text

Fastfile desc "Add Draft Release to GitHub" lane :draftRelease do gradle(task: 'assembleProductionRelease') set_github_release( repository_name: “xxxx", is_draft: true, api_token: ENV['GITHUB_API_TOKEN'], name: ENV['BITRISE_GIT_TAG'], tag_name: ENV[‘BITRISE_GIT_TAG'], description: commits_log, upload_assets: lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS] ) slack(message: “New Draft Release! :)”) end

Slide 35

Slide 35 text

Fastfile desc "Add Draft Release to GitHub" lane :draftRelease do gradle(task: 'assembleProductionRelease') set_github_release( repository_name: “xxxx", is_draft: true, api_token: ENV['GITHUB_API_TOKEN'], name: ENV['BITRISE_GIT_TAG'], tag_name: ENV[‘BITRISE_GIT_TAG'], description: commits_log, upload_assets: lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS] ) slack(message: “New Draft Release! :)”) end

Slide 36

Slide 36 text

Fastfile desc "Add Draft Release to GitHub" lane :draftRelease do gradle(task: 'assembleProductionRelease') set_github_release( repository_name: “xxxx", is_draft: true, api_token: ENV['GITHUB_API_TOKEN'], name: ENV['BITRISE_GIT_TAG'], tag_name: ENV[‘BITRISE_GIT_TAG'], description: commits_log, upload_assets: lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS] ) slack(message: “New Draft Release! :)”) end

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

•Caching .gradle / gem files •Automated screenshots upload •Run Bitrise from Slack chat WANT

Slide 39

Slide 39 text

•jcenter.bintray.com issue(Not technically Bitrise issue) •Sometimes it fails to download Android package NOTICE

Slide 40

Slide 40 text

Summary

Slide 41

Slide 41 text

•Bitrise × Fastlane works nicely •file-downloader works as well Summary

Slide 42

Slide 42 text

Tips for Bitrise Android @shaunkawano Thank you!