Skip to content

Commit 82ab343

Browse files
committed
WIP
1 parent f726c35 commit 82ab343

File tree

20 files changed

+417
-27
lines changed

20 files changed

+417
-27
lines changed

bitrise.yml

Lines changed: 150 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,6 +2106,143 @@ workflows:
21062106
--org mozilla --project klar-ios "$BITRISE_DSYM_DIR_PATH"
21072107
21082108
# RelPro workflows
2109+
release_promotion_promote_focus:
2110+
before_run:
2111+
- focus-clone-and-build-dependencies
2112+
- focus-set-project-version
2113+
- focus-set-default-browser-entitlement
2114+
- focus-configure-nimbus
2115+
- focus-configure-sentry
2116+
steps:
2117+
2118+
title: Override default bitrise scheme
2119+
inputs:
2120+
- content: |-
2121+
#!/usr/bin/env bash
2122+
set -ex
2123+
2124+
if [[ "$BITRISE_APP_TITLE" == "staging-firefox-ios" ]]; then
2125+
BUILD_TYPE="Debug"
2126+
else
2127+
BUILD_TYPE="Release"
2128+
fi
2129+
2130+
if [[ ! -z "${API_BITRISE_SCHEME}" ]]; then
2131+
envman add --key BITRISE_SCHEME --value "${API_BITRISE_SCHEME}"
2132+
envman add --key BITRISE_CONFIG --value "${API_BITRISE_SCHEME}${BUILD_TYPE}"
2133+
else
2134+
envman add --key BITRISE_SCHEME --value "Focus"
2135+
envman add --key BITRISE_CONFIG --value "Focus${BUILD_TYPE}"
2136+
fi
2137+
2138+
# If the current bitrise application is `staging-firefox-ios`, then
2139+
# this is a test release made from the staging repository.
2140+
# Ignore the value passed by release promotion for `BITRISE_SCHEME` and
2141+
# force it to `FirefoxStaging`, which makes it use non production
2142+
# certs/profiles. Also override the export method since the scheme is
2143+
# using a developer ID, not a distribution one
2144+
title: Set staging environment variables
2145+
inputs:
2146+
- content: |-
2147+
#!/usr/bin/env bash
2148+
set -ex
2149+
envman add --key EXPORT_METHOD --value development
2150+
run_if: |-
2151+
{{enveq "BITRISE_APP_TITLE" "staging-firefox-ios"}}
2152+
- certificate-and-profile-installer@1: {}
2153+
- xcode-archive@5:
2154+
inputs:
2155+
- project_path: focus-ios/Blockzilla.xcodeproj
2156+
- compile_bitcode: 'no'
2157+
- upload_bitcode: 'no'
2158+
- team_id: 43AQ936H96
2159+
- export_method: "$EXPORT_METHOD"
2160+
- output_tool: xcodebuild
2161+
- distribution_method: "$EXPORT_METHOD"
2162+
- export_development_team: 43AQ936H96
2163+
- configuration: ${BITRISE_CONFIG}
2164+
- platform: "iOS"
2165+
- scheme: ${BITRISE_SCHEME}
2166+
title: Build Focus
2167+
2168+
envs:
2169+
- opts:
2170+
is_expand: false
2171+
EXPORT_METHOD: app-store
2172+
description: This step is used during release promotion to build a focus release
2173+
2174+
release_promotion_push_focus:
2175+
before_run:
2176+
- SPM_Common_Steps
2177+
envs:
2178+
- IPA_PATH: /tmp/Client.ipa
2179+
- DSYM_PATH: /tmp/symbols.zip
2180+
steps:
2181+
2182+
title: Override default bitrise scheme
2183+
inputs:
2184+
- content: |-
2185+
#!/usr/bin/env bash
2186+
set -ex
2187+
2188+
if [[ ! -z "${API_BITRISE_SCHEME}" ]]; then
2189+
envman add --key BITRISE_SCHEME --value "${API_BITRISE_SCHEME}"
2190+
else
2191+
envman add --key BITRISE_SCHEME --value "Focus"
2192+
fi
2193+
2194+
if [[ "${API_BITRISE_SCHEME}" == "Focus" ]]; then
2195+
envman add --key SENTRY_PROJECT --value "focus-ios"
2196+
else
2197+
envman add --key SENTRY_PROJECT --value "klar-ios"
2198+
fi
2199+
- file-downloader@1:
2200+
title: Download Artifact
2201+
inputs:
2202+
- destination: $IPA_PATH
2203+
- source: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/$BUILD_TASK_ID/artifacts/public%2Frelease_promotion_promote_focus%2FFirefox%20${BITRISE_SCHEME}.ipa
2204+
- file-downloader@1:
2205+
title: Download symbols
2206+
inputs:
2207+
- destination: $DSYM_PATH
2208+
- source: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/$BUILD_TASK_ID/artifacts/public%2Frelease_promotion_promote_focus%2FFirefox%20${BITRISE_SCHEME}.dSYM.zip
2209+
2210+
title: Check if IPA was downloaded
2211+
inputs:
2212+
- content: |-
2213+
#!/usr/bin/env bash
2214+
set -xe
2215+
echo "$IPA_PATH"
2216+
file "$IPA_PATH"
2217+
2218+
title: Check if symbols were downloaded
2219+
inputs:
2220+
- content: |-
2221+
#!/usr/bin/env bash
2222+
set -xe
2223+
echo "$DSYM_PATH"
2224+
file "$DSYM_PATH"
2225+
2226+
title: Upload Firefox Focus Symbols
2227+
run_if: |-
2228+
{{enveq "BITRISE_APP_TITLE" "firefox-ios"}}
2229+
inputs:
2230+
- content: |-
2231+
#!/usr/bin/env bash
2232+
set -xe
2233+
firefox-ios/ThirdParty/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN" upload-dif \
2234+
--org mozilla --project ${SENTRY_PROJECT} "$DSYM_PATH"
2235+
- deploy-to-itunesconnect-application-loader@1:
2236+
title: Deploy to AppStoreConnect
2237+
run_if: |-
2238+
{{enveq "BITRISE_APP_TITLE" "firefox-ios"}}
2239+
inputs:
2240+
- connection: 'off'
2241+
- app_password: "$APPLE_ACCOUNT_PW"
2242+
- itunescon_user: "$APPLE_ACCOUNT_ID"
2243+
- ipa_path: $IPA_PATH
2244+
- retries: 5
2245+
21092246
release_promotion_promote:
21102247
before_run:
21112248
- SPM_Common_Steps
@@ -2296,19 +2433,19 @@ app:
22962433
TEST_FLIGHT_EXTERNAL_GROUP_NAME: Nightly
22972434

22982435

2299-
trigger_map:
2300-
- push_branch: main
2301-
pipeline: pipeline_build_and_test
2302-
- push_branch: epic-branch/*
2303-
pipeline: pipeline_build_and_test
2304-
- push_branch: release/*
2305-
pipeline: pipeline_build_and_test
2306-
- pull_request_target_branch: main
2307-
pipeline: pipeline_build_and_test
2308-
- pull_request_target_branch: epic-branch/*
2309-
pipeline: pipeline_build_and_test
2310-
- pull_request_target_branch: release/v*
2311-
pipeline: pipeline_build_and_test
2436+
#trigger_map:
2437+
#- push_branch: main
2438+
# pipeline: pipeline_build_and_test
2439+
#- push_branch: epic-branch/*
2440+
# pipeline: pipeline_build_and_test
2441+
#- push_branch: release/*
2442+
# pipeline: pipeline_build_and_test
2443+
#- pull_request_target_branch: main
2444+
# pipeline: pipeline_build_and_test
2445+
#- pull_request_target_branch: epic-branch/*
2446+
# pipeline: pipeline_build_and_test
2447+
#- pull_request_target_branch: release/v*
2448+
# pipeline: pipeline_build_and_test
23122449

23132450
meta:
23142451
bitrise.io:

taskcluster/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,9 @@ release-promotion:
5959
target-tasks-method: push
6060
ship:
6161
target-tasks-method: ship
62+
promote_focus:
63+
target-tasks-method: promote_focus
64+
push_focus:
65+
target-tasks-method: push_focus
66+
ship_focus:
67+
target-tasks-method: ship_focus

taskcluster/ffios_taskgraph/release_promotion.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,18 @@ def release_promotion_action(parameters, graph_config, input, task_group_id, tas
177177
)
178178
)
179179

180+
product = "focus" if "focus" in parameters["shipping_phase"] else "firefox"
180181
parameters["version"] = version_string
181-
parameters["head_tag"] = "firefox-v{}".format(version_string)
182+
parameters["head_tag"] = "{}-v{}".format(product, version_string)
182183
parameters["next_version"] = input["next_version"]
183184

184185
release_type = "release"
185186
version = MobileIosVersion.parse(version_string)
186187
if version.is_beta:
187188
release_type = "beta"
188189

190+
191+
parameters["product_type"] = product
189192
parameters["release_type"] = release_type
190193
parameters["tasks_for"] = "action"
191194
parameters["pull_request_number"] = None

taskcluster/ffios_taskgraph/target_tasks.py

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def target_tasks_promote(full_task_graph, parameters, graph_config):
4141
parameters,
4242
filtered_for_candidates=[],
4343
shipping_phase="promote",
44+
product_type="firefox",
4445
)
4546

4647
@register_target_task("push")
@@ -51,7 +52,11 @@ def target_tasks_push(full_task_graph, parameters, graph_config):
5152
graph_config,
5253
)
5354
return _filter_release_promotion(
54-
full_task_graph, parameters, filtered_for_candidates, shipping_phase="push"
55+
full_task_graph,
56+
parameters,
57+
filtered_for_candidates,
58+
shipping_phase="push",
59+
product_type="firefox",
5560
)
5661

5762
@register_target_task("ship")
@@ -62,20 +67,67 @@ def target_tasks_ship(full_task_graph, parameters, graph_config):
6267
graph_config,
6368
)
6469
return _filter_release_promotion(
65-
full_task_graph, parameters, filtered_for_candidates, shipping_phase="ship"
70+
full_task_graph,
71+
parameters,
72+
filtered_for_candidates,
73+
shipping_phase="ship",
74+
product_type="firefox",
75+
)
76+
77+
@register_target_task("promote_focus")
78+
def target_tasks_promote_focus(full_task_graph, parameters, graph_config):
79+
return _filter_release_promotion(
80+
full_task_graph,
81+
parameters,
82+
filtered_for_candidates=[],
83+
shipping_phase="promote",
84+
product_type="focus",
85+
)
86+
87+
@register_target_task("push_focus")
88+
def target_tasks_push_focus(full_task_graph, parameters, graph_config):
89+
filtered_for_candidates = target_tasks_promote(
90+
full_task_graph,
91+
parameters,
92+
graph_config,
93+
)
94+
return _filter_release_promotion(
95+
full_task_graph,
96+
parameters,
97+
filtered_for_candidates,
98+
shipping_phase="push",
99+
product_type="focus",
100+
)
101+
102+
@register_target_task("ship_focus")
103+
def target_tasks_ship_focus(full_task_graph, parameters, graph_config):
104+
filtered_for_candidates = target_tasks_push(
105+
full_task_graph,
106+
parameters,
107+
graph_config,
108+
)
109+
return _filter_release_promotion(
110+
full_task_graph,
111+
parameters,
112+
filtered_for_candidates,
113+
shipping_phase="ship",
114+
product_type="focus",
66115
)
67116

68117
def does_task_match_release_type(task, release_type):
69118
return task.attributes.get("release-type") == release_type
70119

71120
def _filter_release_promotion(
72-
full_task_graph, parameters, filtered_for_candidates, shipping_phase,
121+
full_task_graph, parameters, filtered_for_candidates, shipping_phase, product_type,
73122
):
74123
def filter(task, parameters):
75124
# Include promotion tasks; these will be optimized out
76125
if task.label in filtered_for_candidates:
77126
return True
78127

128+
if task.attributes.get("product-type") != parameters["product_type"]:
129+
return False
130+
79131
if not should_build_type_get_targetted_for_release_type(task, parameters["release_type"]):
80132
return False
81133

taskcluster/ffios_taskgraph/transforms/mark_as_shipped.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def resolve_keys(config, tasks):
1717
item_name=task["name"],
1818
**{
1919
"release-type": task["attributes"]["release-type"],
20+
"product-type": task["attributes"]["product-type"],
2021
"level": config.params["level"],
2122
}
2223
)
@@ -26,7 +27,7 @@ def resolve_keys(config, tasks):
2627
@transforms.add
2728
def add_release_name(config, tasks):
2829
for task in tasks:
29-
product = "Firefox-ios" # Shipit capitalizes the product names
30+
product = "{}-ios".format(task["attributes"]["product-type"].capitalize()) # Shipit capitalizes the product names
3031
version = config.params.get("version", "[UNKNOWN]")
3132
build_number = config.params.get("build_number", 1)
3233
task.setdefault("worker", {})["release-name"] = f"{product}-{version}-build{build_number}"

taskcluster/ffios_taskgraph/transforms/relpro_push.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@
77
@transforms.add
88
def resolve_keyed_by_build_type(config, tasks):
99
for task in tasks:
10-
resolve_keyed_by(task, 'treeherder.symbol', task["name"], **{'build-type': task['attributes']['build-type']})
10+
resolve_keyed_by(task, 'treeherder.symbol', task["name"], **{'build-type': task['attributes']['build-type'], 'flavor': task['attributes'].get('flavor')})
1111
build_type = task["attributes"]["build-type"]
12+
is_focus = task["attributes"]["product-type"] == "focus"
13+
dependency_label = task["attributes"]["flavor"] if is_focus else build_type
1214

1315
for workflow in task["worker"]["bitrise"]["workflows"]:
1416
for params in workflow.values():
15-
params.append({"BUILD_TASK_ID": {"task-reference": f"<promote-{build_type}>"}})
17+
param = {"BUILD_TASK_ID": {"task-reference": f"<promote-{dependency_label}>"}}
18+
if is_focus:
19+
param["API_BITRISE_SCHEME"] = task["attributes"]["flavor"].capitalize()
20+
params.append(param)
1621

1722
yield task

taskcluster/kinds/github-release/kind.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@ tasks:
1919
group-by: filtered-build-type
2020
unique-kinds: false
2121
copy-attributes: true
22+
set-name: false
23+
with-attributes:
24+
product-type:
25+
- firefox
2226
run-on-tasks-for: []
2327
treeherder:
2428
symbol: gh-r
2529
tier: 1
2630
kind: build
2731
platform: ios/opt
32+
attributes:
33+
product-type: firefox
2834
worker-type: github
2935
shipping-phase: ship
3036
worker:
@@ -58,3 +64,41 @@ tasks:
5864
by-release-type:
5965
release: "This is a staging release of firefox-iOS v{version}. It should not be used."
6066
beta: "This is a staging beta of firefox-iOS v{version}. It should not be used."
67+
68+
publish-focus:
69+
description: Create a Github release
70+
from-deps:
71+
group-by: filtered-build-type
72+
unique-kinds: false
73+
copy-attributes: true
74+
set-name: false
75+
with-attributes:
76+
product-type:
77+
- focus
78+
attributes:
79+
product-type: focus
80+
release-type: release
81+
run-on-tasks-for: []
82+
treeherder:
83+
symbol: gh-rf
84+
tier: 1
85+
kind: build
86+
platform: ios/opt
87+
worker-type: github
88+
shipping-phase: ship
89+
worker:
90+
action: release
91+
git-tag: "{head_tag}"
92+
is-prerelease: false
93+
github-project:
94+
by-level:
95+
'3': firefox-ios
96+
default: staging-firefox-ios
97+
release-name:
98+
by-level:
99+
'3': "Focus/Klar v{version}"
100+
default: "Staging Focus/Klar v{version}"
101+
release-body:
102+
by-level:
103+
'3': "This is our official v{version} release of Focus/Klar."
104+
default: "This is a staging release of Focus/Klar v{version}. It should not be used."

0 commit comments

Comments
 (0)