From d09a2a6f7ae130a4cbd0baefc71c55fe04270f2d Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Mon, 15 Apr 2024 21:12:39 -0300 Subject: [PATCH] gitlab-ci: Drop 'packaging' stage This stage was introduced in 076e4d68 and it fulfilled well its purpose. But the side effects were: more (sometimes slow) uploading and downloading of packages and artifacts. Even if we have caching, this is far from ideal. Now, the so-called "packaging" jobs were moved inside in the "build" jobs. The advantages are: just one pacman install (ideally cached from deps job); direct packaging without waiting for upload/download; and less confusion, since "packaging" naming was implying that the .zips are somewhat official, which isn't totally true, and sometimes overlaps the dist/deploy concept. --- Also, the flatpak job now uses config.h instead of triggering a GIMP build. In other words, I'm reverting part of my work in some old commits. --- .gitlab-ci.yml | 96 ++++--------------- .../gitlab-ci/3_package-gimp-uni_base.sh | 13 +-- 2 files changed, 20 insertions(+), 89 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d4f13d9304..fb00a5f66b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ # - GIMP_CI_MSYS2_WIN64: trigger the native MSYS2 build for Win 64-bit. # - GIMP_CI_MSYS2_WIN32: trigger the native MSYS2 build for Win 32-bit. # - GIMP_CI_SOURCES: trigger the Debian build and the source tarball job. -# - GIMP_CI_FLATPAK: trigger the (normally) weekly flatpak build and publishing. +# - GIMP_CI_FLATPAK: trigger the flatpak build and publishing. # - GIMP_CI_WIN_INSTALLER: trigger all native MSYS2 builds then creates Inno Windows installer. # - GIMP_CI_CPPCHECK: trigger cppcheck static analysis. @@ -27,7 +27,6 @@ stages: - prepare - dependencies - gimp - - packaging - distribution - analysis @@ -90,7 +89,6 @@ image-debian-x64: - if: '$GIMP_CI_RASTER_ICONS != null' - if: '$GIMP_CI_CROSSROAD_WIN64 != null' - if: '$GIMP_CI_SOURCES != null' - - if: '$GIMP_CI_FLATPAK != null' # On merge requests and commits. - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - if: '$CI_PIPELINE_SOURCE == "push"' @@ -239,7 +237,6 @@ deps-debian-x64: - if: '$GIMP_CI_RASTER_ICONS != null' - if: '$GIMP_CI_CROSSROAD_WIN64 != null' - if: '$GIMP_CI_SOURCES != null' - - if: '$GIMP_CI_FLATPAK != null' # On merge requests and commits. - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - if: '$CI_PIPELINE_SOURCE == "push"' @@ -281,7 +278,6 @@ gimp-debian-x64: - if: '$GIMP_CI_MESON_CLANG != null' - if: '$GIMP_CI_CROSSROAD_WIN64 != null' - if: '$GIMP_CI_SOURCES != null' - - if: '$GIMP_CI_FLATPAK != null' # On merge requests and commits. - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - if: '$CI_PIPELINE_SOURCE == "push"' @@ -306,7 +302,6 @@ gimp-debian-x64: - _build${ARTIFACTS_SUFFIX}/config.h - _build${ARTIFACTS_SUFFIX}/meson-dist/ - _build${ARTIFACTS_SUFFIX}/devel-docs/ - - _build${ARTIFACTS_SUFFIX}/build/flatpak/ - _build${ARTIFACTS_SUFFIX}/meson-logs/ reports: junit: "_build${ARTIFACTS_SUFFIX}/meson-logs/testlog.junit.xml" @@ -337,7 +332,7 @@ gimp-debian-raster-icons: - ninja test include: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml' -packaging-flatpak-x64: +gimp-flatpak-x64: # See: https://gitlab.gnome.org/GNOME/Initiatives/-/wikis/DevOps-with-Flatpak # XXX This job is mostly the same as .flatpak job of # flatpak_ci_initiative.yml so far, except that we removed the @@ -349,8 +344,8 @@ packaging-flatpak-x64: - if: '$GIMP_CI_FLATPAK != null' # Merge requests with appropriate label. - if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. Flatpak package.*/' - needs: ["gimp-debian-x64"] - stage: packaging + needs: [] + stage: gimp tags: - flatpak image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master' @@ -383,8 +378,12 @@ packaging-flatpak-x64: # Print the date, since appstream depends on local timezone - date && date -u - # Get pre-configured manifest from Debian job - - cp _build${ARTIFACTS_SUFFIX}/build/flatpak/*json build/flatpak/ + # Configure manifest + - flatpak build-init ${GIMP_PREFIX} $APP_ID org.gnome.Sdk org.gnome.Platform + - flatpak build ${GIMP_PREFIX} meson setup _build${ARTIFACTS_SUFFIX} || echo "Generated log" + - GIMP_APP_VERSION=$(grep 'Project version' _build${ARTIFACTS_SUFFIX}/meson-logs/meson-log.txt | head -1 | sed -e 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/' -e 's/\([0-9]\+\.[0-9]\+\)\..*/\1/') + - sed -i "s/@GIMP_APP_VERSION@/$GIMP_APP_VERSION/g" build/flatpak/org.gimp.GIMP-nightly.json.in + - mv build/flatpak/org.gimp.GIMP-nightly.json.in build/flatpak/org.gimp.GIMP-nightly.json # GNOME script to customize the manifest - rewrite-flatpak-manifest ${MANIFEST_PATH} ${FLATPAK_MODULE} ${CONFIG_OPTS} @@ -399,7 +398,6 @@ packaging-flatpak-x64: - flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH} - tar cf repo.tar repo/ artifacts: - expose_as: 'Linux flatpak' paths: - flatpak-builder.log # These are the same as flatpak_ci_initiative.yml as according to @@ -408,7 +406,7 @@ packaging-flatpak-x64: - repo.tar - '.flatpak-builder/build/gimp/_flatpak_build/meson-logs/meson-log.txt' - '.flatpak-builder/build/gimp/_flatpak_build/meson-logs/testlog.txt' - expire_in: 1 week + expire_in: 2 days ## WINDOWS 64-bit CI (cross-build crossroad) ## @@ -467,22 +465,6 @@ gimp-win-x64-cross: script: - bash -x build/windows/gitlab-ci/2_build-gimp-crossroad.sh - crossroad w64 gimp --run="build/windows/gitlab-ci/2_build-gimp-crossroad.sh" - artifacts: - paths: - - _install-x64-cross/ - - _build-x64-cross/ - expire_in: 1 day - -packaging-win-x64-nightly: - extends: .win-cross - rules: - - !reference [.win-x64-cross, rules] - needs: ["gimp-win-x64-cross"] - stage: packaging - variables: - CROSSROAD_PLATFORM: "w64" - cache: [] - script: - bash -x build/windows/gitlab-ci/3_package-gimp-uni_base.sh - cd gimp-x64 - bash -x ../build/windows/gitlab-ci/3_package-gimp-uni_sym.sh @@ -551,23 +533,6 @@ gimp-win-a64: stage: gimp script: - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/2_build-gimp-msys2.sh" - artifacts: - paths: - - _install-a64/ - - _build-a64/meson-*/ - # Needed by dist-installer-weekly - - _build-a64/config.h - - _build-a64/build/windows/installer/ - expire_in: 1 day - -packaging-win-a64: - extends: .win-a64 - rules: - - !reference [.win-a64, rules] - needs: ["gimp-win-a64"] - stage: packaging - cache: [] - script: - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/3_package-gimp-uni_base.sh" - cd gimp-a64 - C:\msys64\usr\bin\bash -lc "bash -x ../build/windows/gitlab-ci/3_package-gimp-uni_sym.sh" @@ -575,7 +540,7 @@ packaging-win-a64: paths: - gimp-a64/ - done-dll.list - # Just passing-through files for dist-installer-weekly + # Needed by dist-installer-weekly - _build-a64/config.h - _build-a64/build/windows/installer/ expire_in: 1 day @@ -614,20 +579,6 @@ gimp-win-x64: stage: gimp script: - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/2_build-gimp-msys2.sh" - artifacts: - paths: - - _install-x64/ - - _build-x64/meson-*/ - expire_in: 1 day - -packaging-win-x64: - extends: .win-x64 - rules: - - !reference [.win-x64, rules] - needs: ["gimp-win-x64"] - stage: packaging - cache: [] - script: - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/3_package-gimp-uni_base.sh" - cd gimp-x64 - C:\msys64\usr\bin\bash -lc "bash -x ../build/windows/gitlab-ci/3_package-gimp-uni_sym.sh" @@ -673,20 +624,6 @@ gimp-win-x86: stage: gimp script: - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/2_build-gimp-msys2.sh" - artifacts: - paths: - - _install-x86/ - - _build-x86/meson-*/ - expire_in: 1 day - -packaging-win-x86: - extends: .win-x86 - rules: - - !reference [.win-x86, rules] - needs: ["gimp-win-x86"] - stage: packaging - cache: [] - script: - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/3_package-gimp-uni_base.sh" - cd gimp-x86 - C:\msys64\usr\bin\bash -lc "bash -x ../build/windows/gitlab-ci/3_package-gimp-uni_sym.sh" @@ -789,14 +726,19 @@ dist-flatpak-weekly: rules: # Custom builds though web GUI, API or schedules. - if: '$GIMP_CI_FLATPAK != null' - needs: ["packaging-flatpak-x64"] + needs: ["gimp-flatpak-x64"] stage: distribution + artifacts: + expose_as: 'Linux flatpak' + paths: + - gimp-git.flatpak + expire_in: 1 week dist-installer-weekly: extends: .win rules: - !reference [.win, rules] - needs: ["packaging-win-a64", "packaging-win-x64", "packaging-win-x86"] + needs: ["gimp-win-a64", "gimp-win-x64", "gimp-win-x86"] stage: distribution tags: - win32-ps diff --git a/build/windows/gitlab-ci/3_package-gimp-uni_base.sh b/build/windows/gitlab-ci/3_package-gimp-uni_base.sh index ca7d5421e8..773c9e63f4 100644 --- a/build/windows/gitlab-ci/3_package-gimp-uni_base.sh +++ b/build/windows/gitlab-ci/3_package-gimp-uni_base.sh @@ -8,7 +8,7 @@ if [[ "$MSYSTEM_CARCH" == "aarch64" ]]; then export ARTIFACTS_SUFFIX="-a64" export MSYS_PREFIX="c:/msys64${MSYSTEM_PREFIX}" export GIMP_DISTRIB=`realpath ./gimp-a64` -elif [[ "$CROSSROAD_PLATFORM" == "w64" ]] || [[ "$MSYSTEM_CARCH" == "x86_64" ]]; then +elif [[ "$CI_JOB_NAME" == "gimp-win-x64-cross" ]] || [[ "$MSYSTEM_CARCH" == "x86_64" ]]; then export ARTIFACTS_SUFFIX="-x64" export MSYS_PREFIX="c:/msys64${MSYSTEM_PREFIX}" export GIMP_DISTRIB=`realpath ./gimp-x64` @@ -18,10 +18,6 @@ else # [[ "$MSYSTEM_CARCH" == "i686" ]]; export GIMP_DISTRIB=`realpath ./gimp-x86` fi -if [[ "$BUILD_TYPE" != "CI_CROSS" ]] && [[ "$BUILD_TYPE" != "CI_NATIVE" ]]; then - pacman --noconfirm -Suy -fi - if [[ "$BUILD_TYPE" == "CI_CROSS" ]]; then apt-get update @@ -31,13 +27,6 @@ if [[ "$BUILD_TYPE" == "CI_CROSS" ]]; then file \ libglib2.0-bin \ python3 -else - # Install the required (pre-built) packages again - # We take code from deps script to better maintenance - GIMP_DIR="" - DEPS_CODE=$(cat build/windows/gitlab-ci/1_build-deps-msys2.sh) - DEPS_CODE=$(sed -n '/# Install the/,/# End of install/p' <<< $DEPS_CODE) - echo "$DEPS_CODE" | bash fi