Revision control

Copy as Markdown

# 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: noreply@mozilla.com
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:
- notify.email.fxr-releng@mozilla.com.on-any
- 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: noreply@mozilla.com
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:
- notify.email.fxr-releng@mozilla.com.on-any
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: noreply@mozilla.com
source: ${repository}