Greetings everyone! I am new to Bitrise, so I am gradually learning their service. I have a question regarding generating APKs. How can I setup my builds to generate APKs based on build variants? I have posted my YAML below. And my assumptions on changes. Can anyone help with this? Thanks in advanced
Here is our premise
- We have 3 environments i.e. debug, stage, release
- We have 2 product flavors i.e. freemium, subscription
format_version: '4’
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: android
trigger_map:
- pull_request_source_branch: development
workflow: debug
pull_request_target_branch: development - tag: Test
workflow: debug - tag: Stage
workflow: stage - tag: Production
workflow: release
workflows:
release:
steps:- activate-ssh-key@3.1.1:
run_if: ‘{{getenv “SSH_RSA_PRIVATE_KEY” | ne “”}}’ - git-clone@4.0.5: {}
- cache-pull@2.0.1: {}
- script@1.1.5:
title: Do anything with Script step - install-missing-android-tools@2.0.6: {}
- gradle-runner@1.8.0:
inputs:- gradle_file: “$GRADLE_BUILD_FILE_PATH”
- gradle_task: assembleRelease
- gradlew_path: "$GRADLEW_PATH"
inputs: <---- I added this input - gradle_file: “$GRADLE_BUILD_FILE_PATH”
- gradle_task: assembleReleaseFreemium
- gradlew_path: "$GRADLEW_PATH"
inputs: <---- I added this input - gradle_file: “$GRADLE_BUILD_FILE_PATH”
- gradle_task: assembleReleaseSubscription
- gradlew_path: “$GRADLEW_PATH”
- deploy-to-bitrise-io@1.3.10: {}
- cache-push@2.0.3: {}
stage:
steps: - activate-ssh-key@3.1.1:
run_if: ‘{{getenv “SSH_RSA_PRIVATE_KEY” | ne “”}}’ - git-clone@4.0.5: {}
- cache-pull@2.0.1: {}
- script@1.1.5:
title: Do anything with Script step - install-missing-android-tools@2.0.6: {}
- gradle-runner@1.8.0:
inputs:- gradle_file: “$GRADLE_BUILD_FILE_PATH”
- gradle_task: assembleStage
- gradlew_path: "$GRADLEW_PATH"
inputs: <---- I added this input - gradle_file: “$GRADLE_BUILD_FILE_PATH”
- gradle_task: assembleStageFreemium
- gradlew_path: "$GRADLEW_PATH"
inputs: <---- I added this input - gradle_file: “$GRADLE_BUILD_FILE_PATH”
- gradle_task: assembleStageSubscription
- gradlew_path: “$GRADLEW_PATH”
- deploy-to-bitrise-io@1.3.10: {}
- cache-push@2.0.3: {}
debug:
steps: - activate-ssh-key@3.1.1:
run_if: ‘{{getenv “SSH_RSA_PRIVATE_KEY” | ne “”}}’ - git-clone@4.0.5: {}
- cache-pull@2.0.1: {}
- script@1.1.5:
title: Do anything with Script step - install-missing-android-tools@2.0.6: {}
- gradle-runner@1.8.0:
inputs:- gradle_file: “$GRADLE_BUILD_FILE_PATH”
- gradle_task: assembleDebug
- gradlew_path: "$GRADLEW_PATH"
inputs: <---- I added this input - gradle_file: “$GRADLE_BUILD_FILE_PATH”
- gradle_task: assembleDebugFreemium
- gradlew_path: "$GRADLEW_PATH"
inputs: <---- I added this input - gradle_file: “$GRADLE_BUILD_FILE_PATH”
- gradle_task: assembleDebugSubscription
- gradlew_path: “$GRADLEW_PATH”
- deploy-to-bitrise-io@1.3.10: {}
- cache-push@2.0.3: {}
after_run: - stage
- release
app:
envs: - opts:
is_expand: false
GRADLE_BUILD_FILE_PATH: build.gradle - opts:
is_expand: false
GRADLEW_PATH: “./gradlew”
- activate-ssh-key@3.1.1: