forked from mozilla-mobile/focus-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.taskcluster.yml
178 lines (178 loc) · 7.34 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
166
167
168
169
170
171
172
173
174
175
176
177
178
version: 1
policy:
pullRequests: public
tasks:
###############################################################################
# Task: Pull requests
#
# Triggered whenever a pull request is opened or updated.
#
# - Build the app (all flavors)
# - Run unit tests
# - Run code quality tools (spotbugs, lint, checkstyle etc.)
###############################################################################
- $if: 'tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"]'
then:
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes: []
payload:
maxRunTime: 7200
image: mozillamobile/focus-android:1.0
command:
- /bin/bash
- --login
- -cx
- >-
git fetch ${event.pull_request.head.repo.clone_url} ${event.pull_request.head.ref}
&& git config advice.detachedHead false
&& git checkout ${event.pull_request.head.sha}
&& echo "--" > .adjust_token
&& python tools/l10n/check_locales.py
&& ./gradlew --no-daemon clean assembleFocusX86Debug assembleKlarX86Nightly assembleRelease detektCheck ktlint lintFocusX86Debug lintKlarX86Nightly pmd checkstyle spotbugs testFocusX86DebugUnitTest testKlarX86NightlyUnitTest
artifacts:
public:
type: directory
path: /opt/focus-android/app/build/reports
expires: {$fromNow: '1 week'}
metadata:
name: Focus for Android - Build - Pull Request
description: Building Focus for Android (via Gradle) - triggered by a pull request.
owner: ${event.pull_request.user.login}@users.noreply.github.com
source: ${event.repository.url}
###############################################################################
# Task: Master builds
#
# Triggered whenever something is pushed/merged to the master branch.
#
# Creates the following task pipeline:
#
# Build -+--> Unit tests ----+- UI tests --> Preview release
# \-> Code quality -/
#
###############################################################################
- $if: 'tasks_for == "github-push"'
then:
$if: 'event.ref == "refs/heads/master"'
then:
taskId: {$eval: as_slugid("decision_task")}
# The next line won't be needed anymore after https://github.com/taskcluster/taskcluster-github/pull/273
taskGroupId: {$eval: as_slugid("decision_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes:
- queue:create-task:aws-provisioner-v1/github-worker
- queue:scheduler-id:taskcluster-github
- secrets:get:project/focus/preview-key-store
- queue:route:index.project.focus.android.preview-builds
- secrets:get:project/focus/firebase
- secrets:get:project/focus/nimbledroid
payload:
maxRunTime: 7200
image: mozillamobile/focus-android:1.0
features:
taskclusterProxy: true
env:
TASK_ID: {$eval: as_slugid("decision_task")}
GITHUB_HEAD_REPO_URL: ${event.repository.clone_url}
GITHUB_HEAD_BRANCH: ${event.ref}
GITHUB_HEAD_SHA: ${event.after}
command:
- /bin/bash
- --login
- -cx
- >-
git fetch origin
&& git config advice.detachedHead false
&& git checkout ${event.after}
&& python tools/taskcluster/schedule-master-build.py
artifacts:
public:
type: directory
path: /build/fenix/preview
expires: {$fromNow: '1 month'}
metadata:
name: (Focus for Android) Schedule tasks
description: Scheduling tasks for master push
owner: ${event.pusher.name}@users.noreply.github.com
source: ${event.repository.url}
###############################################################################
# Task: Release builds
#
# Triggered when a new tag or release is published (in any branch)
#
# - Builds release versions of Focus and Klar
# - Signs the builds with the release key
# - Uploads the builds to the "alpha" track on Google Play
###############################################################################
- $if: 'tasks_for == "github-release"'
then:
taskId: {$eval: as_slugid("decision_task")}
# The next line won't be needed anymore after https://github.com/taskcluster/taskcluster-github/pull/273
taskGroupId: {$eval: as_slugid("decision_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
expires: {$fromNow: '1 year'}
provisionerId: aws-provisioner-v1
workerType: gecko-focus # This workerType has ChainOfTrust enabled
scopes:
- queue:create-task:aws-provisioner-v1/github-worker
- queue:create-task:highest:aws-provisioner-v1/gecko-focus
- queue:create-task:highest:scriptworker-prov-v1/mobile-signing-v1
- queue:create-task:highest:scriptworker-prov-v1/mobile-pushapk-v1
- queue:scheduler-id:taskcluster-github
- project:mobile:focus:releng:signing:cert:release-signing
- project:mobile:focus:releng:signing:format:focus-jar
- project:mobile:focus:releng:googleplay:product:focus
- secrets:get:project/focus/tokens
- queue:route:index.project.mobile.focus.release.latest
payload:
maxRunTime: 7200
image: mozillamobile/focus-android:1.0
features:
taskclusterProxy: true
chainOfTrust: true
env:
TASK_ID: {$eval: as_slugid("decision_task")}
GITHUB_HEAD_REPO_URL: ${event.repository.clone_url}
GITHUB_HEAD_BRANCH: ${event.release.target_commitish}
GITHUB_HEAD_SHA: ${event.release.tag_name}
command:
- /bin/bash
- --login
- -cx
- >-
git fetch origin --tags
&& git config advice.detachedHead false
&& git checkout ${event.release.tag_name}
&& python tools/taskcluster/release.py \
--tag ${event.release.tag_name} \
--track alpha \
--commit \
--output /opt/focus-android/app/build/outputs/apk \
--apk focusX86/release/app-focus-x86-release-unsigned.apk \
--apk klarX86/release/app-klar-x86-release-unsigned.apk \
--apk focusArm/release/app-focus-arm-release-unsigned.apk \
--apk klarArm/release/app-klar-arm-release-unsigned.apk
artifacts:
public/task-graph.json:
type: file
path: /opt/focus-android/task-graph.json
expires: {$fromNow: '1 year'}
public/actions.json:
type: file
path: /opt/focus-android/actions.json
expires: {$fromNow: '1 year'}
public/parameters.yml:
type: file
path: /opt/focus-android/parameters.yml
expires: {$fromNow: '1 year'}
metadata:
name: (Focus for Android) Decision task (${event.release.tag_name})
description: Scheduling tasks for releasing Focus/Klar
owner: ${event.sender.login}@users.noreply.github.com
source: ${event.repository.clone_url}