1
0
Fork 0
mutter-performance-source/.gitlab-ci/export-artifact-path
Florian Müllner bcfbc7fa17 ci: Use meson introspect to generate artifact path
We currently assume that the `CI_COMMIT_TAG` variable matches the
version component of the generated dist tarball.

That is usually correct, but sometimes errors happen and a wrong
tag is pushed, and the real release uses something like "46.0-real".

Account for that by building the artifact path from `meson introspect`
and exporting it as environment variable.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3775>
2024-05-24 20:55:23 +00:00

21 lines
695 B
JavaScript
Executable file

#!/usr/bin/gjs -m
// SPDX-FileCopyrightText: 2024 Florian Müllner <fmuellner@gnome.org>
//
// SPDX-License-Identifier: GPL-2.0-or-later
import Gio from 'gi://Gio';
import {programArgs, programInvocationName, exit} from 'system';
const [buildDir] = programArgs;
if (!buildDir) {
printerr(`usage: ${programInvocationName} <build-dir>`);
exit(1);
}
const subprocess = Gio.Subprocess.new(
['meson', 'introspect', '--projectinfo', buildDir],
Gio.SubprocessFlags.STDOUT_PIPE);
const [, out] = subprocess.communicate_utf8(null, null);
const {descriptive_name, version} = JSON.parse(out);
print(`TARBALL_ARTIFACT_PATH=${buildDir}/meson-dist/${descriptive_name}-${version}.tar.xz`);