From 2689c78439270c60476fe88ae425c06ff986ff08 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 18 Jul 2022 15:14:43 +1200 Subject: [PATCH] ENH Add php version to outputted composer.json --- .github/workflows/ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10c7392..36f9563 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -351,6 +351,7 @@ jobs: # c) Prevent installation of silverstripe/vendor-plugin < 1.5.2 which contains a bugfix # which is required for --prefer-lowest to install # https://github.com/silverstripe/vendor-plugin/pull/49 + # d) Set version of PHP to make it easier to copy paste composer.json to local dev environment php -r ' $j = json_decode(file_get_contents("composer.json")); $j->{"prefer-stable"} = true; @@ -358,7 +359,9 @@ jobs: if (empty($j->config)) { $j->config = new stdClass(); } - $j->config->{"preferred-install"} = new stdClass(); + if (empty($j->config->{"preferred-install"})) { + $j->config->{"preferred-install"} = new stdClass(); + } $j->config->{"preferred-install"}->{"silverstripe/*"} = "source"; $j->config->{"preferred-install"}->{"creative-commoners/*"} = "source"; $j->config->{"preferred-install"}->{"symbiote/*"} = "source"; @@ -372,6 +375,10 @@ jobs: $j->conflict = new stdClass(); } $j->conflict->{"silverstripe/vendor-plugin"} = "<1.5.2"; + if (empty($j->config->platform)) { + $j->config->platform = new stdClass(); + } + $j->config->platform->php = "${{ matrix.php }}"; file_put_contents("composer.json", json_encode($j, JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES)); '