mirror of
https://github.com/icewind1991/nextcloud-version-matrix.git
synced 2026-06-03 09:34:12 +02:00
switch to checking github tags for php releases
This commit is contained in:
parent
7d433286e9
commit
58becf3b4b
3 changed files with 19 additions and 23 deletions
2
.github/workflows/info.xml
vendored
2
.github/workflows/info.xml
vendored
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<info>
|
||||
<dependencies>
|
||||
<nextcloud min-version="25" max-version="28" />
|
||||
<nextcloud min-version="25" max-version="29" />
|
||||
</dependencies>
|
||||
</info>
|
||||
20
dist/index.js
vendored
20
dist/index.js
vendored
|
|
@ -42555,12 +42555,8 @@ function parseVersionId(raw) {
|
|||
return parseInt(matches[1], 10) / 10 + parseInt(matches[2], 10) / 10
|
||||
}
|
||||
|
||||
async function getAllPhpVersions() {
|
||||
// again hacky, but gives a nicely always-up-to-date list
|
||||
let res = await client.get(`https://www.php.net/releases/`);
|
||||
let releasesHtml = await res.readBody();
|
||||
let matches = [...releasesHtml.matchAll(/<h2>(\d+\.\d+\.\d+)<\/h2>/g)];
|
||||
return matches.map(match => match[1]);
|
||||
async function isPhpVersionReleased(version) {
|
||||
return await urlExist(`https://github.com/php/php-src/releases/tag/php-${version.toFixed(1)}.0`);
|
||||
}
|
||||
|
||||
async function distroSupportsPhpVersion(version) {
|
||||
|
|
@ -42629,7 +42625,8 @@ function copy(obj) {
|
|||
|
||||
const versions = range(minVersion, maxVersion);
|
||||
|
||||
const versionData= await Promise.all(versions.map(async (version) => {
|
||||
// we reverse the order to put highest version first for the "branched off check"
|
||||
const versionData= (await Promise.all(versions.reverse().map(async (version) => {
|
||||
const branch = await getBranch(version);
|
||||
const php = await getSupportedVersions(branch);
|
||||
return {
|
||||
|
|
@ -42637,9 +42634,7 @@ function copy(obj) {
|
|||
"phpMax": php.max,
|
||||
"branch": branch,
|
||||
}
|
||||
}));
|
||||
// parseFloat will ignore patch versions, leaving us with all major and minor releases
|
||||
const possiblePhpVersions = (await getAllPhpVersions()).map(parseFloat).filter(onlyUnique);
|
||||
}))).reverse();
|
||||
|
||||
// matrix with a single php version per server version
|
||||
const serverMatrix = cartesianProduct({
|
||||
|
|
@ -42662,8 +42657,11 @@ function copy(obj) {
|
|||
for(let version = phpMin; version <= phpMax; version += 0.1) {
|
||||
// floats are a pain
|
||||
version = parseFloat(version.toFixed(1));
|
||||
if (possiblePhpVersions.includes(version)) {
|
||||
if (await isPhpVersionReleased(version)) {
|
||||
php.push(version.toFixed(1));
|
||||
} else {
|
||||
// no more minors for this major
|
||||
version = Math.ceil(version) - 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,12 +41,8 @@ function parseVersionId(raw) {
|
|||
return parseInt(matches[1], 10) / 10 + parseInt(matches[2], 10) / 10
|
||||
}
|
||||
|
||||
async function getAllPhpVersions() {
|
||||
// again hacky, but gives a nicely always-up-to-date list
|
||||
let res = await client.get(`https://www.php.net/releases/`);
|
||||
let releasesHtml = await res.readBody();
|
||||
let matches = [...releasesHtml.matchAll(/<h2>(\d+\.\d+\.\d+)<\/h2>/g)];
|
||||
return matches.map(match => match[1]);
|
||||
async function isPhpVersionReleased(version) {
|
||||
return await urlExist(`https://github.com/php/php-src/releases/tag/php-${version.toFixed(1)}.0`);
|
||||
}
|
||||
|
||||
async function distroSupportsPhpVersion(version) {
|
||||
|
|
@ -115,7 +111,8 @@ function copy(obj) {
|
|||
|
||||
const versions = range(minVersion, maxVersion);
|
||||
|
||||
const versionData= await Promise.all(versions.map(async (version) => {
|
||||
// we reverse the order to put highest version first for the "branched off check"
|
||||
const versionData= (await Promise.all(versions.reverse().map(async (version) => {
|
||||
const branch = await getBranch(version);
|
||||
const php = await getSupportedVersions(branch);
|
||||
return {
|
||||
|
|
@ -123,9 +120,7 @@ function copy(obj) {
|
|||
"phpMax": php.max,
|
||||
"branch": branch,
|
||||
}
|
||||
}));
|
||||
// parseFloat will ignore patch versions, leaving us with all major and minor releases
|
||||
const possiblePhpVersions = (await getAllPhpVersions()).map(parseFloat).filter(onlyUnique);
|
||||
}))).reverse();
|
||||
|
||||
// matrix with a single php version per server version
|
||||
const serverMatrix = cartesianProduct({
|
||||
|
|
@ -148,8 +143,11 @@ function copy(obj) {
|
|||
for(let version = phpMin; version <= phpMax; version += 0.1) {
|
||||
// floats are a pain
|
||||
version = parseFloat(version.toFixed(1));
|
||||
if (possiblePhpVersions.includes(version)) {
|
||||
if (await isPhpVersionReleased(version)) {
|
||||
php.push(version.toFixed(1));
|
||||
} else {
|
||||
// no more minors for this major
|
||||
version = Math.ceil(version) - 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue