-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extract PHP version restrictions
- Loading branch information
1 parent
34e4bf5
commit 627dde1
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
## | ||
# @license http://unlicense.org/UNLICENSE The UNLICENSE | ||
# @author William Desportes <[email protected]> | ||
## | ||
|
||
if ! command -v jq &> /dev/null | ||
then | ||
echo "jq could not be found" | ||
exit 1 | ||
fi | ||
|
||
set -e | ||
|
||
git checkout -q gh-pages > /dev/null | ||
|
||
# Only normal releases | ||
FOUND_PHARS="$(find ./releases/ -type f -name 'VERSION' -not -path '*-dev/*' -not -path '*/dev/*' -not -path '*/latest/*' | sort -n)" | ||
|
||
VERSION_COMPAT='{}' | ||
|
||
for file in $FOUND_PHARS; do | ||
VERSION="$(cat "$file")" | ||
COMPOSER_JSON="$(git show "v${VERSION}:./composer.json")" | ||
REQUIRED_VERSION="$(printf '%s' "${COMPOSER_JSON}" | jq -r .require.php)" | ||
VERSION_COMPAT="$(echo "${VERSION_COMPAT} {\"${VERSION}\": \"${REQUIRED_VERSION}\"}" | jq -s add)" | ||
done | ||
|
||
printf '%s' "${VERSION_COMPAT}" | jq -r | ||
|
||
git checkout -q - > /dev/null | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
## | ||
# @license http://unlicense.org/UNLICENSE The UNLICENSE | ||
# @author William Desportes <[email protected]> | ||
## | ||
|
||
set -e | ||
|
||
VERSIONS_COMPAT="$(./scripts/extract-php-version-constraints.sh)" | ||
|
||
git checkout gh-pages | ||
|
||
printf '%s\n' "${VERSIONS_COMPAT}" > versions-platform-compatibility.json | ||
# Parsing check | ||
jq -r '.' versions-platform-compatibility.json > /dev/null | ||
|
||
# Commit the changes | ||
git add -A "versions-platform-compatibility.json" | ||
git commit -S -m "Update the version compatibility file" -m "#versions-compat" | ||
|
||
git checkout - |