This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 217
/
.taskcluster.yml
166 lines (164 loc) · 7.66 KB
/
.taskcluster.yml
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
version: 1
reporting: checks-v1
policy:
pullRequests: public
tasks:
$let:
repository:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.repo.clone_url}
else: ${event.repository.clone_url}
isFeatureBranch:
$if: 'tasks_for == "github-push"'
then: {$eval: 'event.ref[0:19] == "refs/heads/feature/"'}
else: false
in:
###############################################################################
# Task: Pull requests
#
# Triggered whenever a pull request is opened or updated.
#
# - Builds NoAPI and GoogleVR flavors
###############################################################################
- $if: 'tasks_for == "github-pull-request" && event["action"] in ["opened", "edited", "reopened", "synchronize"]'
then:
provisionerId: 'proj-firefoxreality'
workerType: 'ci-linux'
deadline: {$fromNow: 1 day}
expires: {$fromNow: 1 year}
payload:
maxRunTime: 14400
image: 'mozillamixedreality/firefoxreality:200316-SDK29'
command:
- /bin/bash
- '--login'
- '-cx'
- >-
git fetch ${repository} ${event.pull_request.head.ref}
&& git config advice.detachedHead false
&& git checkout ${event.pull_request.head.sha}
&& git submodule update --init --recursive
&& ./gradlew --no-daemon --console=plain clean `python tools/taskcluster/build_targets.py =all+noapi=all`
&& ./gradlew app:testNoapiArm64DebugUnitTest
metadata:
name: Firefox Reality for Android - Build - Pull Request
description: Building Firefox Reality for Android (via Gradle) - triggered by a pull request.
owner: [email protected]
source: ${repository}
###############################################################################
# Task: Main builds
#
# Triggered whenever something is pushed/merged to the main branch.
# Produces APKs signed with the staging key. These APKs are for
# testing only and should not be uploaded to App Stores.
#
###############################################################################
- $if: 'tasks_for == "github-push" && (event["ref"] == "refs/heads/main" || isFeatureBranch == true)'
then:
$let:
featureName:
$if: 'isFeatureBranch == true'
then: "-f ${event.ref[19:]}"
else: "-f main"
in:
provisionerId: 'proj-firefoxreality'
workerType: 'ci-linux'
deadline: {$fromNow: 1 day}
expires: {$fromNow: 1 year}
scopes:
- "secrets:get:project/firefoxreality/fr/github-deploy-key"
- "secrets:get:project/firefoxreality/fr/staging-signing-token"
- "secrets:get:project/firefoxreality/fr/symbols-token"
- "secrets:get:project/firefoxreality/fr/mls-key"
routes:
- index.project.firefoxreality.main
payload:
maxRunTime: 14400
image: 'mozillamixedreality/firefoxreality:200316-SDK29'
features:
taskclusterProxy: true
command:
- /bin/bash
- '--login'
- '-cx'
- >-
git fetch origin
&& git config advice.detachedHead false
&& git checkout -b build-${event.after} ${event.after}
&& rm -rf gvr-android-sdk && git clone https://github.com/MozillaReality/FirefoxReality-gvr-android-sdk.git gvr-android-sdk
&& git submodule update --init --recursive
&& . tools/taskcluster/get_third_party.sh
&& python tools/taskcluster/fetch_secret.py -s project/firefoxreality/fr/mls-key -o .mls_token -n key
&& cp tools/gradle/taskcluster.properties ./user.properties
&& ./gradlew --no-daemon --console=plain clean `python tools/taskcluster/build_targets.py =all`
&& python tools/taskcluster/fetch_secret.py -s project/firefoxreality/fr/staging-signing-token -o token -n token
&& python tools/taskcluster/sign_apk.py -t token ${featureName}
&& python tools/taskcluster/archive_debug_apk.py
&& . tools/taskcluster/upload_symbols.sh
artifacts:
'public':
type: 'directory'
path: '/opt/FirefoxReality/builds/'
expires: {$fromNow: '1 month'}
metadata:
name: Firefox Reality for Android - Build - ${event.ref[11:]} update
description: Building Firefox Reality for Android (via Gradle) - triggered by update to ${event.ref[11:]} branch
owner: [email protected]
source: ${repository}
###############################################################################
# Task: Release builds
#
# Triggered when a new release is tagged. Produces signed release APKs.
#
###############################################################################
- $if: 'tasks_for == "github-release" && event["action"] == "published"'
then:
provisionerId: 'proj-firefoxreality'
workerType: 'ci-linux'
deadline: {$fromNow: 1 day}
expires: {$fromNow: 1 year}
scopes:
- "secrets:get:project/firefoxreality/fr/github-deploy-key"
- "secrets:get:project/firefoxreality/fr/release-signing-token"
- "secrets:get:project/firefoxreality/fr/symbols-token"
- "secrets:get:project/firefoxreality/fr/mls-key"
routes:
payload:
maxRunTime: 14400
image: 'mozillamixedreality/firefoxreality:200316-SDK29'
features:
taskclusterProxy: true
command:
- /bin/bash
- '--login'
- '-cx'
- >-
git fetch origin
&& git config advice.detachedHead false
&& git checkout ${event.release.tag_name}
&& rm -rf gvr-android-sdk && git clone https://github.com/MozillaReality/FirefoxReality-gvr-android-sdk.git gvr-android-sdk
&& git submodule update --init --recursive
&& . tools/taskcluster/get_third_party.sh
&& python tools/taskcluster/fetch_secret.py -s project/firefoxreality/fr/mls-key -o .mls_token -n key
&& cp tools/gradle/taskcluster.properties ./user.properties
&& ./gradlew --no-daemon --console=plain clean `python tools/taskcluster/build_targets.py ${event.release.tag_name}`
&& python tools/taskcluster/fetch_secret.py -s project/firefoxreality/fr/release-signing-token -o token -n token
&& python tools/taskcluster/fetch_secret.py -s project/firefoxreality/fr/release-signing-token -o v1token -n v1
&& python tools/taskcluster/sign_apk.py -t token -c v1token -r
&& python tools/taskcluster/archive_debug_apk.py
&& . tools/taskcluster/upload_symbols.sh
artifacts:
'public':
type: 'directory'
path: '/opt/FirefoxReality/builds/'
expires: {$fromNow: '1 year'}
metadata:
name: Firefox Reality for Android - Release Build (${event.release.tag_name})
description: Building Firefox Reality for Android (via Gradle) - triggered by release (${event.release.tag_name})
owner: [email protected]
source: ${repository}