Bug 1901703 - Update 'release-flatpak-repackage' task for generated desktop file r=jlorenzo,releng-reviewers,jcristau,taskgraph-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D216374
This commit is contained in:
Alexandre Lissy 2024-08-05 15:01:02 +00:00
Родитель b1eb8a5dea
Коммит 19f90da905
5 изменённых файлов: 38 добавлений и 3 удалений

Просмотреть файл

@ -11,6 +11,7 @@ test "$BUILD_NUMBER"
test "$CANDIDATES_DIR"
test "$L10N_CHANGESETS"
test "$FLATPAK_BRANCH"
test "$DESKTOP_FILE_URL"
# Optional env variables
: WORKSPACE "${WORKSPACE:=/home/worker/workspace}"
@ -70,7 +71,7 @@ for locale in $locales; do
done
envsubst < "$SCRIPT_DIRECTORY/org.mozilla.firefox.appdata.xml.in" > "${WORKSPACE}/org.mozilla.firefox.appdata.xml"
cp -v "$SCRIPT_DIRECTORY/org.mozilla.firefox.desktop" "$WORKSPACE"
$CURL -o "$WORKSPACE/org.mozilla.firefox.desktop" "$DESKTOP_FILE_URL"
cp -v "$SCRIPT_DIRECTORY/launch-script.sh" "$WORKSPACE"
cp -v "$SCRIPT_DIRECTORY/firefox-symbolic.svg" "$WORKSPACE"
cd "${WORKSPACE}"

Просмотреть файл

@ -4,6 +4,7 @@
from taskgraph.transforms.base import TransformSequence
from taskgraph.util.schema import resolve_keyed_by
from taskgraph.util.taskcluster import get_artifact_url
from gecko_taskgraph.util.attributes import release_level
from gecko_taskgraph.util.scriptworker import get_release_config
@ -35,8 +36,27 @@ def format(config, tasks):
**{
"release-level": release_level(config.params["project"]),
"project": config.params["project"],
}
},
)
task["worker"]["env"][k] = env[k].format(**format_params)
yield task
@transforms.add
def add_desktop_file_url(config, tasks):
"""Add desktop file artifact url to task environment"""
for task in tasks:
for dep_task in config.kind_dependencies_tasks.values():
if dep_task.label not in task["dependencies"]:
continue
if dep_task.kind != "repackage":
continue
env = task["worker"]["env"]
assert "DESKTOP_FILE_URL" not in env
env["DESKTOP_FILE_URL"] = {
"task-reference": get_artifact_url(
f"<{dep_task.label}>", "public/build/target.flatpak.desktop"
)
}
yield task

Просмотреть файл

@ -290,6 +290,19 @@ PACKAGE_FORMATS = {
},
"output": "target.langpack.deb",
},
"desktop-file": {
"args": [
"desktop-file",
"--flavor",
"flatpak",
"--release-product",
"firefox",
"--release-type",
"{release_type}",
],
"inputs": {},
"output": "target.flatpak.desktop",
},
}
MOZHARNESS_EXPANSIONS = [
"package-name",

Просмотреть файл

@ -13,6 +13,7 @@ transforms:
kind-dependencies:
- post-beetmover-dummy
- post-langpack-dummy
- repackage
task-defaults:
description: Generates flatpak by reackaging the existing tar.bz2

Просмотреть файл

@ -91,7 +91,7 @@ tasks:
# Debug builds can't be attributable
debug: [dmg, mar, pkg]
default: [dmg-attrib, mar, pkg]
linux.*: [mar]
linux.*: [mar, desktop-file]
win32\b.*: [mar, installer]
win64\b.*: [mar, installer]
fetches: