You can do that, or even better, use Workflow Chaining!
With that you can also define a single “common” workflow, e.g. which builds an app based on a Project Path and Scheme parameter, and then define workflows which just define these environment variables and then run the “common” workflow.
Something like:
---
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
workflows:
common:
steps:
- activate-ssh-key:
- git-clone:
- ...
- xcode-archive:
- ...
build-app1:
envs:
- BITRISE_SCHEME: Scheme1
- BITRISE_PROJECT_PATH: ./path/to/app1
after_run:
- common
build-app2:
envs:
- BITRISE_SCHEME: Scheme2
- BITRISE_PROJECT_PATH: ./path/to/app2
after_run:
- common
Or if you want to chain multiple builds in a single build:
---
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
workflows:
_prepare:
steps:
- activate-ssh-key:
- git-clone:
_build-common:
- ...
- xcode-archive:
- ...
build-app1:
envs:
- BITRISE_SCHEME: Scheme1
- BITRISE_PROJECT_PATH: ./path/to/app1
after_run:
- _build-common
build-app2:
envs:
- BITRISE_SCHEME: Scheme2
- BITRISE_PROJECT_PATH: ./path/to/app2
after_run:
- _build-common
build-all:
before_run:
- _prepare
after_run:
- build-app1
- build-app2
With this config you can build the build-all
workflow, which will prepare (git clone etc.) once, and then build all the app variants.