Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions .github/workflows/auto-rc-ota-build-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
##############################################################################################
#
# Auto RC OTA / build core (reusable)
#
# Shared logic for the Auto RC flow (build-rc-auto.yml): detect an OTA_VERSION bump and either
# dispatch push-eas-update.yml, or fall through to build.yml.
#
# Runway's manual entry workflows no longer use this file — they call the dedicated OTA-only or
# build-only workflows (runway-ota-*.yml, runway-*-builds.yml) directly. Kept here to preserve
# automatic OTA-vs-build detection on every push to a release branch.
#
##############################################################################################
name: Auto RC OTA Build Core

on:
workflow_call:
inputs:
platform:
description: 'Target platform passed to push-eas-update and build.yml (android or ios)'
required: true
type: string
source_branch:
description: >-
Optional branch, tag, or SHA (Build workflow source_branch).
Empty uses the branch selected in the caller workflow_dispatch "Use workflow from" UI.
required: false
type: string
default: ''
ota_channel:
description: 'push-eas-update channel input (e.g. rc, production)'
required: false
type: string
default: rc
build_name:
description: 'build.yml build_name (e.g. main-rc, main-prod)'
required: false
type: string
default: main-rc
create_production_ota_tag:
description: 'If true, create OTA release tag after production trigger-ota (callers: *production* only)'
required: false
type: boolean
default: false
environment:
description: 'Build environment / track passed to upload-to-testflight (e.g. rc, prod)'
required: false
type: string
default: 'rc'
skip_version_bump:
description: >-
If true, build.yml skips update-latest-build-version. Auto-RC callers set true since the
bump is performed once upstream.
required: false
type: boolean
default: false
outputs:
semantic_version:
description: 'package.json version at the built commit (empty when OTA path taken)'
value: ${{ jobs.trigger-build.outputs.semantic_version }}
ios_version_code:
description: 'iOS CURRENT_PROJECT_VERSION at the built commit (empty when OTA path taken)'
value: ${{ jobs.trigger-build.outputs.ios_version_code }}
android_version_code:
description: 'Android versionCode at the built commit (empty when OTA path taken)'
value: ${{ jobs.trigger-build.outputs.android_version_code }}

permissions:
contents: write # required by build.yml (update-build-version job)
pull-requests: read
actions: write
id-token: write # required by build.yml

jobs:
resolve-context:
name: Resolve OTA context
uses: ./.github/workflows/runway-ota-resolve-context.yml
with:
source_branch: ${{ inputs.source_branch }}
secrets: inherit

validate-ota-pr:
name: Validate PR for OTA
needs: resolve-context
if: needs.resolve-context.outputs.ota_bump == 'true'
runs-on: ubuntu-latest
steps:
- name: Validate PR number
run: |
if [[ -z "${{ needs.resolve-context.outputs.pr_number }}" ]]; then
echo "::error::No PR found for this branch. OTA update requires a PR number."
echo "::error::If you ran the workflow manually (workflow_dispatch), select your release branch in the 'Use workflow from' dropdown (e.g. release/7.71.0), not main."
exit 1
fi
echo "Using PR #${{ needs.resolve-context.outputs.pr_number }}"

trigger-ota:
name: Trigger OTA update
needs: [resolve-context, validate-ota-pr]
if: needs.resolve-context.outputs.ota_bump == 'true'
uses: ./.github/workflows/push-eas-update.yml
with:
pr_number: ${{ needs.resolve-context.outputs.pr_number }}
base_branch: ${{ needs.resolve-context.outputs.base_ref }}
message: ${{ needs.resolve-context.outputs.ota_version }}
channel: ${{ inputs.ota_channel }}
platform: ${{ inputs.platform }}
secrets: inherit

trigger-build:
name: Trigger build mobile app
needs: resolve-context
if: needs.resolve-context.outputs.ota_bump != 'true'
uses: ./.github/workflows/build.yml
with:
build_name: ${{ inputs.build_name }}
platform: ${{ inputs.platform }}
skip_version_bump: ${{ inputs.skip_version_bump }}
source_branch: ${{ inputs.source_branch || github.ref_name }}
upload_to_sentry: true
secrets: inherit

create-ota-production-tag:
name: Create OTA production release tag
needs: [resolve-context, trigger-ota]
if: ${{ inputs.create_production_ota_tag == true }}
uses: ./.github/workflows/runway-create-ota-production-tag.yml
with:
tag_name: ${{ needs.resolve-context.outputs.ota_version }}
checkout_ref: ${{ inputs.source_branch || github.ref_name }}
secrets: inherit

upload-ios-testflight:
name: Upload iOS to TestFlight
needs: [trigger-build]
if: ${{ inputs.platform == 'ios' }}
uses: ./.github/workflows/upload-to-testflight.yml
with:
environment: ${{ inputs.environment }}
source_branch: ${{ inputs.source_branch || github.ref_name }}
build_branch: ${{ inputs.source_branch || github.ref_name }}
build_name: ${{ inputs.build_name }}
build_commit_sha: ${{ needs.trigger-build.outputs.built_commit_sha }}
build_version: ${{ needs.trigger-build.outputs.semantic_version }}
build_number: ${{ needs.trigger-build.outputs.ios_version_code }}
secrets: inherit
6 changes: 3 additions & 3 deletions .github/workflows/build-rc-auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Bitrise "Rolling builds" / "Abort running builds" for one branch + one workflow).
#
# Version bump runs once (update-latest-build-version.yml), then iOS and Android
# builds are triggered in parallel via runway-ota-build-core.yml (skip_version_bump).
# builds are triggered in parallel via auto-rc-ota-build-core.yml (skip_version_bump).
#
# The RC build comment includes an AI-generated test plan (inline with collapsible sections).
#
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:

trigger-ios-rc-build:
name: Trigger iOS RC Build
uses: ./.github/workflows/runway-ota-build-core.yml
uses: ./.github/workflows/auto-rc-ota-build-core.yml
needs:
- validate-and-find-pr
- update_rc_build_version
Expand All @@ -117,7 +117,7 @@ jobs:

trigger-android-rc-build:
name: Trigger Android RC Build
uses: ./.github/workflows/runway-ota-build-core.yml
uses: ./.github/workflows/auto-rc-ota-build-core.yml
needs:
- validate-and-find-pr
- update_rc_build_version
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/runway-android-production-workflow.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/runway-android-rc-workflow.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/runway-ios-production-workflow.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/runway-ios-rc-workflow.yml

This file was deleted.

Loading
Loading