mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
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/gnome-shell/-/merge_requests/3340>
(cherry picked from commit 27445a1c98)
This commit is contained in:
parent
e8679b5ed6
commit
5e063d3167
2 changed files with 43 additions and 2 deletions
|
|
@ -249,6 +249,23 @@ flatpak:
|
|||
nightly:
|
||||
extends: '.publish_nightly'
|
||||
|
||||
distinfo:
|
||||
stage: deploy
|
||||
needs:
|
||||
- build
|
||||
script:
|
||||
- .gitlab-ci/export-artifact-path build > dist.env
|
||||
artifacts:
|
||||
reports:
|
||||
dotenv: dist.env
|
||||
paths:
|
||||
- build
|
||||
- mutter
|
||||
- subprojects/jasmine-gjs
|
||||
- dist.env
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
|
||||
dist:
|
||||
variables:
|
||||
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
|
||||
|
|
@ -267,13 +284,16 @@ dist:
|
|||
- "**/meson.build"
|
||||
- meson/*
|
||||
|
||||
|
||||
dist-tarball:
|
||||
extends: dist
|
||||
needs:
|
||||
- distinfo
|
||||
artifacts:
|
||||
expose_as: 'Get tarball here'
|
||||
paths:
|
||||
- build/meson-dist/$CI_PROJECT_NAME-$CI_COMMIT_TAG.tar.xz
|
||||
- $TARBALL_ARTIFACT_PATH
|
||||
reports:
|
||||
dotenv: dist.env
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
|
||||
|
|
|
|||
21
.gitlab-ci/export-artifact-path
Executable file
21
.gitlab-ci/export-artifact-path
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/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`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue