variables:
  COMPOSER_HOME: /cache/composer

build:
  image: composer
  script:
    - composer install --no-dev --no-interaction
    - |
      cd vendor-bin/box
      composer install --no-interaction
      cd -
      mkdir -p vendor/bin
      ln -s "$(realpath vendor-bin/box/vendor/bin/box)" vendor/bin/box
    - ./bin/platform self:build --no-composer-rebuild --yes --replace-version "$CI_COMMIT_REF_NAME"-"$CI_COMMIT_SHORT_SHA" --output platform.phar
  artifacts:
    expose_as: 'cli-phar'
    paths: ['platform.phar']

variables:
  COMPOSER_HOME: /cache/composer

build:
  image: php:7.4-cli
  before_script:
    - apt-get update
    - apt-get install zip unzip
    - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    - php composer-setup.php
    - mkdir -p /cache/composer/bin && chmod +x composer.phar && mv composer.phar /cache/composer/bin/composer
  script:
    - export PATH="/cache/composer/bin:$PATH"
    - composer install --no-dev --no-interaction
    - |
      cd vendor-bin/box
      composer install --no-interaction
      cd -
      mkdir -p vendor/bin
      ln -s "$(realpath vendor-bin/box/vendor/bin/box)" vendor/bin/box
    - ./bin/platform self:build --no-composer-rebuild --yes --replace-version "$CI_COMMIT_REF_NAME"-"$CI_COMMIT_SHORT_SHA" --output platform.phar
  artifacts:
    expose_as: 'cli-phar'
    paths: ['platform.phar']

Fix GitLab CI build, using PHP 7.4 (for Box compatibility) [skip changelog]
Fix GitLab CI build, using PHP 7.4 (for Box compatibility) [skip changelog]
