-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
145 lines (137 loc) · 5.6 KB
/
auto-rc-ota-build-core.yml
File metadata and controls
145 lines (137 loc) · 5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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