From 866e5de95b457b22b8e5b2ea9db3aeb5d599acd7 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 4 Jan 2024 14:04:36 +0100 Subject: [PATCH] ci: Prepare the macOS build environment in a dedicated CI job. --- gitlab/build.yml | 15 ++++++--------- gitlab/image.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/gitlab/build.yml b/gitlab/build.yml index b87ab969..af68e9ef 100644 --- a/gitlab/build.yml +++ b/gitlab/build.yml @@ -130,7 +130,9 @@ build-mac: exit_codes: - 2 interruptible: true - needs: [] + needs: + - job: image-mac + optional: true dependencies: [] tags: - mac @@ -147,14 +149,9 @@ build-mac: - system_profiler SPSoftwareDataType SPHardwareDataType > artifacts/systeminfo.txt - vulkaninfo > artifacts/vulkaninfo.txt - export PATH="/usr/local/opt/bison/bin:/usr/local/opt/flex/bin:$PATH" - - git clone --depth 1 --branch wine-3.21 https://gitlab.winehq.org/wine/wine.git - - cd wine - - mkdir build - - cd build - - ../configure --enable-win64 --without-x --without-freetype - - make tools/widl/widl - - cd ../.. - - export PATH="$PWD/wine/build/tools/widl:$PATH" + - curl -o image.zip https://gitlab.winehq.org/api/v4/projects/wine%2Fvkd3d/jobs/artifacts/master/download?job=image-mac + - unzip image.zip + - export PATH="$PWD/image/bin:$PATH" - git rebase $CI_MERGE_REQUEST_DIFF_BASE_SHA --exec ./gitlab/build-mac - if [ -f build_failed ] ; then exit 1 ; fi - if [ -f tests_failed ] ; then exit 2 ; fi diff --git a/gitlab/image.yml b/gitlab/image.yml index cda71df6..c93ea0d6 100644 --- a/gitlab/image.yml +++ b/gitlab/image.yml @@ -18,3 +18,32 @@ image-linux: - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"},\"$CI_DEPENDENCY_PROXY_SERVER\":{\"auth\":\"$(printf "%s:%s" "$CI_DEPENDENCY_PROXY_USER" "$CI_DEPENDENCY_PROXY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json - sed -i "1iFROM $IMAGE_SOURCE" "$DOCKER_FILE" - /kaniko/executor --context "$CI_PROJECT_DIR" --dockerfile "$DOCKER_FILE" --destination "$IMAGE_LOCAL" + +image-mac: + stage: image + rules: + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_PROJECT_PATH == "wine/vkd3d" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + changes: + - .gitlab-ci.yml + - gitlab/image.yml + interruptible: true + tags: + - mac + script: + - mkdir image + - cd image + - mkdir bin + - export PATH="/usr/local/opt/bison/bin:/usr/local/opt/flex/bin:$PATH" + - git clone --depth 1 --branch wine-3.21 https://gitlab.winehq.org/wine/wine.git + - cd wine + - mkdir build + - cd build + - ../configure --enable-win64 --without-x --without-freetype + - make tools/widl/widl + - cd ../.. + - cp wine/build/tools/widl/widl bin + - rm -fr wine + - cd .. + artifacts: + paths: + - image