From 89b79e3af75898421f64d6368a522650d9ce9263 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Wed, 11 Dec 2024 15:42:44 +0200 Subject: [PATCH 1/6] ci: Add release component to automate tarball publishing Publishing the dist tarball to download.gnome.org is now automated. See [1] [1] https://gitlab.gnome.org/Teams/Websites/handbook.gnome.org/-/merge_requests/83/ --- .gitlab-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 06b81571e..7bb3a69d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,9 @@ +include: + - component: gitlab.gnome.org/GNOME/citemplates/release-service@master + inputs: + dist-job-name: "dist-job" + tarball-artifact-path: "${TARBALL_ARTIFACT_PATH}" + stages: - style-check - build @@ -19,6 +25,8 @@ variables: MESON_TEST_TIMEOUT_MULTIPLIER: 4 G_MESSAGES_DEBUG: all MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings" + # expected naming scheme for the release-service job + TARBALL_ARTIFACT_PATH: _build/meson-dist/$CI_PROJECT_NAME-$CI_COMMIT_TAG.tar.xz # Default CI job setup; contrast with `.only-origin`. # From 53c197bd61766de7676441f3c05d7931836bfa5e Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 Dec 2024 14:26:50 +0000 Subject: [PATCH 2/6] ci: Slightly improve quoting of variables Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7bb3a69d2..e3031952c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ variables: G_MESSAGES_DEBUG: all MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings" # expected naming scheme for the release-service job - TARBALL_ARTIFACT_PATH: _build/meson-dist/$CI_PROJECT_NAME-$CI_COMMIT_TAG.tar.xz + TARBALL_ARTIFACT_PATH: "_build/meson-dist/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.xz" # Default CI job setup; contrast with `.only-origin`. # From f2488ef526d460b8c8c405a1af9d4412843224b7 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 Dec 2024 15:36:00 +0000 Subject: [PATCH 3/6] ci: Enable -Dintrospection for dist builds This means that the documentation can actually be generated, which was broken before. Building the documentation requires `enable_gir`. Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3031952c..3634cffe1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -848,17 +848,23 @@ pages: - public dist-job: - image: $FEDORA_IMAGE + extends: + - .build-linux + - .with-git + image: "${FEDORA_IMAGE}" stage: build + before_script: + - !reference [".build-linux", "before_script"] + - !reference [".with-git", "before_script"] only: - tags script: - # Ignore extra git security checks as we don't care in CI. - - git config --global --add safe.directory "${PWD}" - - git submodule update --init - - for m in $(git submodule foreach -q 'echo $path'); do git config --global --add safe.directory "${PWD}/${m}"; done - - meson subprojects download - - meson setup ${MESON_COMMON_OPTIONS} --buildtype release -Ddocumentation=true -Dman-pages=enabled _build + - meson setup ${MESON_COMMON_OPTIONS} + --buildtype release + -Ddocumentation=true + -Dintrospection=enabled + -Dman-pages=enabled + _build - meson dist -C _build # Compile again to build the docs - meson compile -C _build From 1c318263d4b8d8239f181643a1624603ab6fee31 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 Dec 2024 15:37:52 +0000 Subject: [PATCH 4/6] ci: Clear dependencies for dist-job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise it never executes, because it’s waiting patiently for zero dependencies to complete. 🤦 Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3634cffe1..38463f9c0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -853,6 +853,7 @@ dist-job: - .with-git image: "${FEDORA_IMAGE}" stage: build + needs: [] before_script: - !reference [".build-linux", "before_script"] - !reference [".with-git", "before_script"] From 72fe3b5970bcda5267591f89beda47d03896152e Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 Dec 2024 15:38:46 +0000 Subject: [PATCH 5/6] ci: Run dist-job on a schedule as well as on tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will allow us to test that it actually still works, which is important for being able to make releases, because once we push a tag, there’s no going back. The release can’t happen if `dist-job` then fails on that tag. Sigh. Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 38463f9c0..e44f246a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -858,6 +858,7 @@ dist-job: - !reference [".build-linux", "before_script"] - !reference [".with-git", "before_script"] only: + - schedules - tags script: - meson setup ${MESON_COMMON_OPTIONS} From 49a1b5114135b977bf7db4c911ff928d5f1d63c1 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 Dec 2024 15:39:40 +0000 Subject: [PATCH 6/6] ci: Fix output paths for docs tarballs in dist-job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise they’re not picked up as artifacts, and hence are basically lost. Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e44f246a6..fd774e9ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -870,11 +870,11 @@ dist-job: - meson dist -C _build # Compile again to build the docs - meson compile -C _build - - tar -c -J -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C _build/docs/reference/glib glib-2.0 - - tar -c -J -f "gmodule-docs-$CI_COMMIT_TAG.tar.xz" -C _build/docs/reference/gmodule gmodule-2.0 - - tar -c -J -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C _build/docs/reference/gobject gobject-2.0 - - tar -c -J -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C _build/docs/reference/gio gio-2.0 - - tar -c -J -f "girepository-docs-$CI_COMMIT_TAG.tar.xz" -C _build/docs/reference/girepository girepository-2.0 + - tar -c -J -f "_build/glib-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/glib glib-2.0 + - tar -c -J -f "_build/gmodule-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/gmodule gmodule-2.0 + - tar -c -J -f "_build/gobject-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/gobject gobject-2.0 + - tar -c -J -f "_build/gio-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/gio gio-2.0 + - tar -c -J -f "_build/girepository-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/girepository girepository-2.0 artifacts: paths: - "${CI_PROJECT_DIR}/_build/glib-docs-$CI_COMMIT_TAG.tar.xz"