mirror of
https://github.com/icewind1991/nextcloud-version-matrix.git
synced 2026-08-02 07:44:44 +02:00
feat: Support PHP min/max version property in info.xml
Signed-off-by: David Dreschner <github-2017@dreschner.net>
This commit is contained in:
parent
8a7bac6300
commit
7a9036702e
3 changed files with 4792 additions and 4781 deletions
3
.github/workflows/info.xml
vendored
3
.github/workflows/info.xml
vendored
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<info>
|
||||
<dependencies>
|
||||
<nextcloud min-version="25" max-version="29" />
|
||||
<php max-version="8.1" />
|
||||
<nextcloud min-version="27" max-version="33" />
|
||||
</dependencies>
|
||||
</info>
|
||||
9549
dist/index.js
vendored
9549
dist/index.js
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -131,23 +131,28 @@ function getPHPVersionID(version) {
|
|||
|
||||
const content = fs.readFileSync(filename, 'utf8');
|
||||
const document = new DOMParser().parseFromString(content);
|
||||
const minVersion = parseInt(xpath.select1("//info//dependencies//nextcloud/@min-version", document).value, 10);
|
||||
const maxVersion = parseInt(xpath.select1("//info//dependencies//nextcloud/@max-version", document).value, 10);
|
||||
const nextcloudMinVersion = parseInt(xpath.select1("//info//dependencies//nextcloud/@min-version", document).value, 10);
|
||||
const nextcloudMaxVersion = parseInt(xpath.select1("//info//dependencies//nextcloud/@max-version", document).value, 10);
|
||||
|
||||
console.log(`App supports from ${minVersion} till ${maxVersion}`);
|
||||
const phpMinVersion = parseFloat(xpath.select1("//info//dependencies//php/@min-version", document)?.value);
|
||||
const phpMaxVersion = parseFloat(xpath.select1("//info//dependencies//php/@max-version", document)?.value);
|
||||
|
||||
const versions = range(minVersion, maxVersion);
|
||||
console.log(`App supports Nextcloud ${nextcloudMinVersion} till ${nextcloudMaxVersion}`);
|
||||
console.log(`App supports PHP ${phpMinVersion} till ${phpMaxVersion} (NaN = no range limit specified)`);
|
||||
|
||||
const versions = range(nextcloudMinVersion, nextcloudMaxVersion);
|
||||
|
||||
// we reverse the order to put highest version first for the "branched off check"
|
||||
const versionData= (await Promise.all(versions.reverse().map(async (version) => {
|
||||
let versionData = (await Promise.all(versions.reverse().map(async (version) => {
|
||||
const branch = await getBranch(version);
|
||||
const php = await getSupportedVersions(branch);
|
||||
const phpVersionRange = await getSupportedVersions(branch);
|
||||
return {
|
||||
"phpMin": php.min,
|
||||
"phpMax": php.max,
|
||||
"phpMin": isNaN(phpMinVersion) ? phpVersionRange.min : Math.max(phpVersionRange.min, phpMinVersion),
|
||||
"phpMax": isNaN(phpMaxVersion) ? phpVersionRange.max : Math.min(phpVersionRange.max, phpMaxVersion),
|
||||
"branch": branch,
|
||||
}
|
||||
}))).reverse();
|
||||
versionData = versionData.filter(data => data.phpMin <= data.phpMax);
|
||||
|
||||
// matrix with a single php version per server version
|
||||
const serverMatrix = cartesianProduct({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue