gitlab-ci, build: Drop custom "CI_*" variables

Let's figure out what job is running using the predefined GitLab variables.
This commit is contained in:
Bruno Lopes 2024-04-23 08:50:33 -03:00
parent 1420e60f45
commit bffe62d43e
4 changed files with 7 additions and 11 deletions

View File

@ -390,7 +390,6 @@ gimp-flatpak-x64:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS == null && $CI_COMMIT_TAG == null' - if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS == null && $CI_COMMIT_TAG == null'
image: $CI_REGISTRY_IMAGE:build-debian-latest image: $CI_REGISTRY_IMAGE:build-debian-latest
variables: variables:
BUILD_TYPE: "CI_CROSS"
# Needed because by default, Debian has now changed # Needed because by default, Debian has now changed
# "sysconfig.get_default_scheme()" from "posix_prefix" to "posix_local" which # "sysconfig.get_default_scheme()" from "posix_prefix" to "posix_local" which
# adds a local/ folder to the install prefix of setup.py. This environment # adds a local/ folder to the install prefix of setup.py. This environment
@ -452,7 +451,6 @@ gimp-win-x64-cross:
# Merge requests with appropriate label. # Merge requests with appropriate label.
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. Windows Installer.*/' - if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. Windows Installer.*/'
variables: variables:
BUILD_TYPE: "CI_NATIVE"
CHERE_INVOKING: "yes" CHERE_INVOKING: "yes"
# We use the same universal variables but not directly from PS # We use the same universal variables but not directly from PS
before_script: [] before_script: []

View File

@ -12,9 +12,7 @@ else # [[ "$MSYSTEM_CARCH" == "i686" ]];
export ARTIFACTS_SUFFIX="-x86" export ARTIFACTS_SUFFIX="-x86"
fi fi
if [[ "$BUILD_TYPE" == "CI_NATIVE" ]]; then if [[ -z "$GITLAB_CI" ]]; then
GIMP_DIR=""
else
# Make the script work locally # Make the script work locally
if [[ "$0" != "build/windows/gitlab-ci/1_build-deps-msys2.sh" ]]; then if [[ "$0" != "build/windows/gitlab-ci/1_build-deps-msys2.sh" ]]; then
echo "To run this script locally, please do it from to the gimp git folder" echo "To run this script locally, please do it from to the gimp git folder"

View File

@ -15,7 +15,7 @@ else # [[ "$MSYSTEM_CARCH" == "i686" ]];
export MSYS2_PREFIX="c:/msys64${MSYSTEM_PREFIX}" export MSYS2_PREFIX="c:/msys64${MSYSTEM_PREFIX}"
fi fi
if [[ "$BUILD_TYPE" == "CI_NATIVE" ]]; then if [[ "$GITLAB_CI" ]]; then
# XXX We've got a weird error when the prefix is in the current dir. # XXX We've got a weird error when the prefix is in the current dir.
# Until we figure it out, this trick seems to work, even though it's # Until we figure it out, this trick seems to work, even though it's
# completely ridiculous. # completely ridiculous.
@ -125,7 +125,7 @@ make_cmd ()
echo "Please run the gimp.cmd file to get proper plug-in support."> ${GIMP_PREFIX}/README.txt echo "Please run the gimp.cmd file to get proper plug-in support."> ${GIMP_PREFIX}/README.txt
} }
if [[ "$BUILD_TYPE" == "CI_NATIVE" ]]; then if [[ "$GITLAB_CI" ]]; then
make_cmd CI %cd% make_cmd CI %cd%
cd .. cd ..

View File

@ -19,7 +19,7 @@ else # [[ "$MSYSTEM_CARCH" == "i686" ]];
fi fi
if [[ "$BUILD_TYPE" == "CI_CROSS" ]]; then if [[ "$CI_JOB_NAME" =~ "cross" ]]; then
apt-get update apt-get update
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
binutils \ binutils \
@ -32,7 +32,7 @@ fi
# Bundle deps and GIMP files # Bundle deps and GIMP files
export GIMP_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}" export GIMP_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}"
if [[ "$BUILD_TYPE" == "CI_CROSS" ]]; then if [[ "$CI_JOB_NAME" =~ "cross" ]]; then
export GIMP_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}-cross" export GIMP_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}-cross"
export MSYS_PREFIX="$GIMP_PREFIX" export MSYS_PREFIX="$GIMP_PREFIX"
fi fi
@ -142,12 +142,12 @@ done
### .pdb (CodeView) debug symbols ### .pdb (CodeView) debug symbols
### TODO: REMOVE 'if [[ "$MSYSTEM...' WHEN GCC 14 IS ON MSYS2 ### TODO: REMOVE 'if [[ "$MSYSTEM...' WHEN GCC 14 IS ON MSYS2
### crossroad don't have LLVM/Clang backend yet ### crossroad don't have LLVM/Clang backend yet
if [[ "$MSYSTEM_CARCH" != "i686" ]] && [[ "$BUILD_TYPE" != "CI_CROSS" ]]; then if [[ "$MSYSTEM_CARCH" != "i686" ]] && [[ ! "$CI_JOB_NAME" =~ "cross" ]]; then
cp -fr ${GIMP_PREFIX}/bin/*.pdb ${GIMP_DISTRIB}/bin/ cp -fr ${GIMP_PREFIX}/bin/*.pdb ${GIMP_DISTRIB}/bin/
fi fi
## Optional executables, .DLLs and resources for GObject Introspection support ## Optional executables, .DLLs and resources for GObject Introspection support
if [[ "$BUILD_TYPE" != "CI_CROSS" ]]; then if [[ ! "$CI_JOB_NAME" =~ "cross" ]]; then
cp -fr ${MSYS_PREFIX}/bin/libgirepository-*.dll ${GIMP_DISTRIB}/bin/ cp -fr ${MSYS_PREFIX}/bin/libgirepository-*.dll ${GIMP_DISTRIB}/bin/
python3 build/windows/gitlab-ci/3_bundle-gimp-uni_dep.py ${GIMP_DISTRIB}/bin/libgirepository-*.dll ${GIMP_PREFIX}/ ${MSYS_PREFIX}/ ${GIMP_DISTRIB} --output-dll-list done-dll.list python3 build/windows/gitlab-ci/3_bundle-gimp-uni_dep.py ${GIMP_DISTRIB}/bin/libgirepository-*.dll ${GIMP_PREFIX}/ ${MSYS_PREFIX}/ ${GIMP_DISTRIB} --output-dll-list done-dll.list
cp -fr ${MSYS_PREFIX}/lib/girepository-*/ ${GIMP_DISTRIB}/lib/ cp -fr ${MSYS_PREFIX}/lib/girepository-*/ ${GIMP_DISTRIB}/lib/